USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  FlexGrid
Edinaldo.La
PARNAMIRIM
RN - BRASIL
ENUNCIADA !
Postada em 22/04/2006 07:02 hs            
Estou precisando de um artigo que me ensine a trabalhar com o FlexGrid. Estou tendo problema quando mostro num FlexGrid uma quantidade de registro de um funcionário e quando mando mostrar de outro funcionário ele mostra uma série de linhas em branco. Grato.
   
LCRamos
não registrado
ENUNCIADA !
Postada em 22/04/2006 09:11 hs   
Procure um artigo sobre isto no macoratti, muito bom.
 
Muito bom.
 
vlu//
   
Geronimo
Pontos: 2843
JOINVILLE
SC - BRASIL
ENUNCIADA !
Postada em 22/04/2006 13:01 hs            
Mais precisamente :
 
Agora se você já esta conseguindo preencher o grid e esta dando erro quando alterna a seleção post o codigo para darmos uma olhada, veja este exemplo:
 
Private Sub cmdpontos_Click()
On Error GoTo Trata_Erro
Me.MousePointer = 11
If DBCdatacompetição = "" Then
    MsgBox "Não há Dados para Visualizar Nesta:" & Chr(13) & "Data de Competição.", 48, "Tiro Alvo Seta"
Else
Set BancoDeDados = OpenDatabase(App.Path & "olao.MDB", False)
Set TBbolão = BancoDeDados.OpenRecordset("select nome,matricula,[1exp],[1tiro1],[1tiro2],[1tiro3],[1tiro4],[1tiro5],[total1],[2exp],[2tiro1],[2tiro2],[2tiro3],[2tiro4],[2tiro5],[total2],[3exp],[3tiro1],[3tiro2],[3tiro3],[3tiro4],[3tiro5],[total3],[4exp],[4tiro1],[4tiro2],[4tiro3],[4tiro4],[4tiro5],[total4],total from bolão where  Data= #" & Format(DBCdatacompetição.Text, "mm/dd/yy") & "# and Equipe='" & Equipe.Text & "'and Local='" & LocalC.Text & "' order by Total desc, nove desc, oito desc, sete desc, seis desc, cinco desc, quatro desc, tres desc, dois desc, um desc,matricula asc")

If Not TBbolão.EOF Then
    With MSFlexGrid1
        .Rows = 1
        .Cols = 32
        .ColWidth(0) = 350
        .ColWidth(1) = 2800
        .ColWidth(2) = 750
        .ColWidth(3) = 350
        .ColWidth(4) = 200
        .ColWidth(5) = 200
        .ColWidth(6) = 200
        .ColWidth(7) = 200
        .ColWidth(8) = 200
        .ColWidth(9) = 450
        .ColWidth(10) = 350
        .ColWidth(11) = 200
        .ColWidth(12) = 200
        .ColWidth(13) = 200
        .ColWidth(14) = 200
        .ColWidth(15) = 200
        .ColWidth(16) = 450
        .ColWidth(17) = 350
        .ColWidth(18) = 200
        .ColWidth(19) = 200
        .ColWidth(20) = 200
        .ColWidth(21) = 200
        .ColWidth(22) = 200
        .ColWidth(23) = 450
        .ColWidth(24) = 350
        .ColWidth(25) = 200
        .ColWidth(26) = 200
        .ColWidth(27) = 200
        .ColWidth(28) = 200
        .ColWidth(29) = 200
        .ColWidth(30) = 450
        .ColWidth(31) = 490
       
        .TextMatrix(0, 0) = ""
        .TextMatrix(0, 1) = "Nome do Atleta"
        .TextMatrix(0, 2) = "Matricula"
        .TextMatrix(0, 3) = "Exp"
        .TextMatrix(0, 4) = "1"
        .TextMatrix(0, 5) = "2"
        .TextMatrix(0, 6) = "3"
        .TextMatrix(0, 7) = "4"
        .TextMatrix(0, 8) = "5"
        .TextMatrix(0, 9) = "Total"
        .TextMatrix(0, 10) = "Exp"
        .TextMatrix(0, 11) = "1"
        .TextMatrix(0, 12) = "2"
        .TextMatrix(0, 13) = "3"
        .TextMatrix(0, 14) = "4"
        .TextMatrix(0, 15) = "5"
        .TextMatrix(0, 16) = "Total"
        .TextMatrix(0, 17) = "Exp"
        .TextMatrix(0, 18) = "1"
        .TextMatrix(0, 19) = "2"
        .TextMatrix(0, 20) = "3"
        .TextMatrix(0, 21) = "4"
        .TextMatrix(0, 22) = "5"
        .TextMatrix(0, 23) = "Total"
        .TextMatrix(0, 24) = "Exp"
        .TextMatrix(0, 25) = "1"
        .TextMatrix(0, 26) = "2"
        .TextMatrix(0, 27) = "3"
        .TextMatrix(0, 28) = "4"
        .TextMatrix(0, 29) = "5"
        .TextMatrix(0, 30) = "Total"
        .TextMatrix(0, 31) = "Total"
    End With
   
i = 1
Do While Not TBbolão.EOF
    With MSFlexGrid1
        .Rows = i + 1
        .ColAlignment(0) = flexAlignCenterCenter ' alinha coluna
        .TextMatrix(i, 0) = i - 0 ' autonumeração colocar zero para poder começar com 1
        .ColAlignment(1) = flexAlignLeftCenter
        .TextMatrix(i, 1) = TBbolão(0)
        .ColAlignment(2) = flexAlignCenterCenter
        .TextMatrix(i, 2) = TBbolão(1)
        .ColAlignment(3) = flexAlignCenterCenter
        .TextMatrix(i, 3) = TBbolão(2)
        .Col = 3
        .Row = i
        .CellForeColor = vbRed
        .ColAlignment(4) = flexAlignCenterCenter
        .TextMatrix(i, 4) = TBbolão(3)
        .ColAlignment(5) = flexAlignCenterCenter
        .TextMatrix(i, 5) = TBbolão(4)
        .ColAlignment(6) = flexAlignCenterCenter
        .TextMatrix(i, 6) = TBbolão(5)
        .ColAlignment(7) = flexAlignCenterCenter
        .TextMatrix(i, 7) = TBbolão(6)
        .ColAlignment(8) = flexAlignCenterCenter
        .TextMatrix(i, 8) = TBbolão(7)
        .ColAlignment(9) = flexAlignCenterCenter
        .TextMatrix(i, 9) = TBbolão(8)
        .Col = 9
        .Row = i
        .CellForeColor = vbBlue
         .ColAlignment(10) = flexAlignCenterCenter
        .TextMatrix(i, 10) = TBbolão(9)
        .Col = 10
        .Row = i
        .CellForeColor = vbRed
        .ColAlignment(11) = flexAlignCenterCenter
        .TextMatrix(i, 11) = TBbolão(10)
        .ColAlignment(12) = flexAlignCenterCenter
        .TextMatrix(i, 12) = TBbolão(11)
        .ColAlignment(13) = flexAlignCenterCenter
        .TextMatrix(i, 13) = TBbolão(12)
        .ColAlignment(14) = flexAlignCenterCenter
        .TextMatrix(i, 14) = TBbolão(13)
        .ColAlignment(15) = flexAlignCenterCenter
        .TextMatrix(i, 15) = TBbolão(14)
        .ColAlignment(16) = flexAlignCenterCenter
        .TextMatrix(i, 16) = TBbolão(15)
        .Col = 16
        .Row = i
        .CellForeColor = vbBlue
        .ColAlignment(17) = flexAlignCenterCenter
        .TextMatrix(i, 17) = TBbolão(16)
        .Col = 17
        .Row = i
        .CellForeColor = vbRed
        .ColAlignment(18) = flexAlignCenterCenter
        .TextMatrix(i, 18) = TBbolão(17)
        .ColAlignment(19) = flexAlignCenterCenter
        .TextMatrix(i, 19) = TBbolão(18)
        .ColAlignment(20) = flexAlignCenterCenter
        .TextMatrix(i, 20) = TBbolão(19)
        .ColAlignment(21) = flexAlignCenterCenter
        .TextMatrix(i, 21) = TBbolão(20)
        .ColAlignment(22) = flexAlignCenterCenter
        .TextMatrix(i, 22) = TBbolão(21)
         .ColAlignment(23) = flexAlignCenterCenter
        .TextMatrix(i, 23) = TBbolão(22)
        .Col = 23
        .Row = i
        .CellForeColor = vbBlue
        .ColAlignment(24) = flexAlignCenterCenter
        .TextMatrix(i, 24) = TBbolão(23)
        .Col = 24
        .Row = i
        .CellForeColor = vbRed
        .ColAlignment(25) = flexAlignCenterCenter
        .TextMatrix(i, 25) = TBbolão(24)
        .ColAlignment(26) = flexAlignCenterCenter
        .TextMatrix(i, 26) = TBbolão(25)
        .ColAlignment(27) = flexAlignCenterCenter
        .TextMatrix(i, 27) = TBbolão(26)
        .ColAlignment(28) = flexAlignCenterCenter
        .TextMatrix(i, 28) = TBbolão(27)
        .ColAlignment(29) = flexAlignCenterCenter
        .TextMatrix(i, 29) = TBbolão(28)
        .ColAlignment(30) = flexAlignCenterCenter
        .TextMatrix(i, 30) = TBbolão(29)
        .Col = 30
        .Row = i
        .CellForeColor = vbBlue
        .ColAlignment(31) = flexAlignCenterCenter
        .TextMatrix(i, 31) = TBbolão(30)
        .Col = 31
        .Row = i
        .CellForeColor = vbBlue
        .CellFontBold = True
    End With
   
i = i + 1
TBbolão.MoveNext
Loop
End If
 End If
 Me.MousePointer = 0
 Exit Sub
Trata_Erro:
MsgBox "Você  Selecionou DADOS INVÁLIDOS!!!!"
End Sub

"O pior inimigo que você poderá encontrar será sempre você mesmo."
   
Edinaldo.La
PARNAMIRIM
RN - BRASIL
ENUNCIADA !
Postada em 23/04/2006 20:20 hs            
Valeu. Obrigado galera!!! Deu certo.
   
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página