Geronimo
|
JOINVILLE SC - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 13/10/2005 19:05 hs
Pessoal tentei com alguns exemplos e dicas fazer com que a linha se ajustasse automaticamente na coluna que recebe comentarios aonde as vezes não há comentarios não necessitando aumentar a mesma.
On Error GoTo Trata_Erro Me.MousePointer = 11 Set BancoDeDados = OpenDatabase(App.Path & "salao.MDB", False) Set TBDados = BancoDeDados.OpenRecordset("select Data,Usuario,comentario,sum (valor) from dados Where Data >= #" & Format(DataInicial, "mm/dd/yy") & "# and data<= #" & Format(DataFinal, "mm/dd/yy") & "# and Nome='" & NomeCliente.Text & "' group by Data,Usuario,comentario order by data desc")
If Not TBDados.EOF Then With MSFlexGrid1 .Rows = 1 .Cols = 5 .ColWidth(0) = 0 .ColWidth(1) = 1000 .ColWidth(2) = 1500 .ColWidth(3) = 6500 .ColWidth(4) = 1000 .TextMatrix(0, 0) = "" .TextMatrix(0, 1) = "Data" .TextMatrix(0, 2) = "Usuario" .TextMatrix(0, 3) = "Comentario" .TextMatrix(0, 4) = "Valor" End With i = 1
Do While Not TBDados.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) = flexAlignCenterCenter .TextMatrix(i, 1) = TBDados(0) .ColAlignment(2) = flexAlignLeftCenter .TextMatrix(i, 2) = TBDados(1) .ColAlignment(3) = flexAlignLeftCenter .TextMatrix(i, 3) = TBDados(2) .ColAlignment(4) = flexAlignRightCenter .TextMatrix(i, 4) = Format(TBDados(3), "Currency") .Col = 4 .Row = i .CellForeColor = vbRed .CellFontBold = True End With i = i + 1 SomaColuna = SomaColuna + TBDados(3) TBDados.MoveNext Loop
' Textbox com o total da coluna Saldo.Text = Format(SomaColuna, "currency")
End If
FlexCores &HFFFFFF, &HC0FFFF
Me.MousePointer = 0
Exit Sub Trata_Erro: MsgBox "Você Selecionou DADOS INVÁLIDOS!!!!"
"O pior inimigo que você poderá encontrar será sempre você mesmo."
|
|
|
|
|
|
Daniel
|
SÃO PAULO SP - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 14/10/2005 14:19 hs
tenho um form que ajusta automaticamente o tamanho das linhas do msflexgrid é If Not G_Abre_MDB(CDb_Relato%) Then G_Sair X1 = "Format$([Conteudo]![Valor1],'#,###.00')" Data1.DatabaseName = Base_Relato.Name Data1.RecordSource = "SELECT Conteudo.Valor2, Conteudo.Texto11, Conteudo.Texto1, Conteudo.Texto2, Conteudo.Texto3," & X1 & " AS Expr2, Conteudo.Valor21, Conteudo.Texto10, Conteudo.Obs FROM Conteudo ORDER BY Conteudo.Texto11, Conteudo.Texto2, Conteudo.Texto10;" Data1.Refresh Grid1.Row = 0 Grid1.Col = 0 Grid1.ColWidth(0) = 0 Grid1.Col = 1 Grid1.ColWidth(1) = 900 Grid1.Text = "Conta" Grid1.Col = 2 Grid1.ColWidth(2) = 900 Grid1.Text = "Dupl." Grid1.Col = 3 Grid1.ColWidth(3) = 3000 Grid1.Text = "Cliente" Grid1.Col = 4 Grid1.ColWidth(4) = 1200 Grid1.Text = "Rep." Grid1.Col = 5 Grid1.ColWidth(5) = 1000 Grid1.ColAlignment(5) = 7 Grid1.Text = "Valor" Grid1.Col = 6 Grid1.ColWidth(6) = 1000 Grid1.Text = "Vencimento" Grid1.Col = 7 Grid1.ColWidth(7) = 1000 Grid1.Text = "Contato em" Grid1.Col = 8 Grid1.ColWidth(8) = 6000 Grid1.Text = "Observação" Grid1.MergeCells = 1 Grid1.MergeCol(3) = True Grid1.MergeCol(4) = True Grid1.MergeCol(7) = True For t = 1 To Grid1.Rows - 1 Grid1.Row = t Grid1.Col = 8 Grid1.RowHeight(t) = (Len(Grid1.Text) / 70 + 1) * 225 ' o divisor irá depender do tamanho da coluna Next t Grid1.ColAlignment(8) = flexAlignLeftCenter Grid1.WordWrap = True ' Retorno automático do texto Grid1.Refresh
dsmn
|
|
|
|
|