Ir para conteúdo
Fórum Script Brasil

gianne

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre gianne

Perfil

  • Gender
    Female
  • Location
    são paulo

gianne's Achievements

0

Reputação

  1. gianne

    dao para ado

    Eu digito o codigo no text1, e click no enter para procurar o codigo e retornar os dados no grid. mais está dando erro RUN-TIME ERROR 91: OBJETO VARIABLE OR WITH BLOCK VARIABLE NOT SET A linha do erro está em vermelho Sub CarregaGrid() Do While Grid1.Rows > 1 Grid1.Rows = Grid1.Rows - 1 Loop Grid1.Rows = Grid1.Rows + 1 If Len(Trim(Text1)) > 0 Then Dim selection2 As String selection2 = "select * from Estamparia where numos = '" & Text1 & "' Order by Contador" ''Set db = OpenDatabase(App.Path & "\bases\Base34.mdb") ''Set tb = db.OpenRecordset(selection2) ''Set tbLocal = db.OpenRecordset(selection2 Set tb = ExecutaRS(selection2) If tb.BOF And tb.EOF Then 'MsgBox "O. S. não apontada. Favor verificar.", vbInformation, "Atenção" Cont = 0 VarMetragem = 0 Label13 = "ÚLTIMA ACUMULADA : 0,00" Else Cont = 0 VarMetragem = 0 result = 0 Grid1.Row = 1 Do While tb.EOF = False With Grid1 If Len(Trim(tb(10))) = 0 Then .CellBackColor = &H80000005 .Col = 0 .Text = tb(6) .Col = 1 .Text = tb(7) .Col = 2 .Text = tb(3) VarMetragem = tb(9) - result result = tb(9) .Col = 3 .Text = VarMetragem .Col = 4 .Text = tb(9) Label13 = "ÚLTIMA ACUMULADA : " & Format(tb(9), "#,##0.00") Set Grid1.DataSource = tbLocal Grid1.Refresh .Col = 5 .Text = tb(0) 'Contador Else .Col = 0 .Text = tb(10) .Col = 1 .Text = tb(10) .Col = 2 .Text = tb(10) .Col = 3 .Text = tb(10) .Col = 4 .Text = tb(10) .Col = 5 .Text = tb(0) 'Contador With tbLocal '.Edit '.Fields(8) = VarMetragem '.Update .MoveNext End With Dim irow As Integer LinhadaGrid = .Row With Grid1 .Row = LinhadaGrid .Col = 0 .RowSel = LinhadaGrid .ColSel = 4 End With For irow = Grid1.Row To Grid1.RowSel Grid1.MergeRow(irow) = True Next Grid1.MergeCells = 2 .CellBackColor = &HE0E0E0 End If End With VarMetragem = 0 Grid1.Rows = Grid1.Rows + 1 Grid1.Row = Grid1.Rows - 1 tb.MoveNext Cont = Cont + 1 Loop If Cont = 0 Then Label8 = "" If Cont = 1 Then Label8 = "1 Lançamento." If Cont > 1 Then Label8 = Cont & " Lançamentos." Dim selection1 As String selection1 = "Select * from Estamparia where Dia = '" & Label5 & "' " ''Set db = OpenDatabase(App.Path & "\Bases\Base34.mdb") ''Set tb = db.OpenRecordset(Selection) Set tb = ExecutaRS(selection1) With tb If .BOF And .EOF Then Else Dim TotalDia As Single TotalDia = 0 Do While .EOF = False If UCase(.Fields(2)) = UCase(Trim(Text6)) Then TotalDia = TotalDia + .Fields(8) End If .MoveNext Loop Label8 = Label8 & " - Total do dia : " & Format(TotalDia, "#,##0.00") & " metros." End If End With End If End If End Sub
×
×
  • Criar Novo...