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

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Pesquisa Nota
Ama
Pontos: 2843
UBERLÂNDIA
MG - BRASIL
Postada em 27/05/2008 11:09 hs         
Private Sub DataGrid1_DblClick()
Dim lngR As Long
Dim Clone_Rs As ADODB.Recordset
Dim strFilter As String
lngR = CLng(DataGrid1.Row + 1)
On Error Resume Next
Adodc1.Refresh: Adodc2.Refresh
Set Clone_Rs = Adodc2.Recordset
Adodc1.Recordset.AbsolutePosition = lngR
strFilter = "code = '" & Adodc1.Recordset.Fields(0) & "' AND reciptno = " & Adodc1.Recordset.Fields(1)
Clone_Rs.Filter = strFilter
If Clone_Rs.EOF Or Clone_Rs.BOF Then
    Adodc2.Recordset.MoveMax
    Adodc2.Recordset.MoveNext
Else
    Adodc2.Recordset.Bookmark = Clone_Rs.Bookmark
End If
    frmPurchaseDetails.txtfornecedor.Text = DataGrid1.Columns(3)
    frmPurchaseDetails.cbocfop.Text = Adodc1.Recordset.Fields(6)
    frmPurchaseDetails.cboespecie.Text = DataGrid1.Columns(3)
    frmPurchaseDetails.cbopgto.Text = IIf(DataGrid1.Columns(4) = "0", "a Vista", "a Prazo")
    frmPurchaseDetails.txtcpf.Text = Adodc1.Recordset.Fields(7)
    frmPurchaseDetails.txtReceipt.Text = DataGrid1.Columns(1)
    frmPurchaseDetails.txtPurchaseCode.Text = DataGrid1.Columns(0)
    frmPurchaseDetails.dtpDate.Value = DataGrid1.Columns(2)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxRow, 1) = Adodc2.Recordset.Fields(0)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxRow, 2) = Adodc2.Recordset.Fields(1)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxRow, 3) = Adodc2.Recordset.Fields(5)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxRow, 4) = Adodc2.Recordset.Fields(6)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxRow, 5) = Adodc2.Recordset.Fields(9)
   frmPurchaseDetails.txtTotal = Format$(CCur((Val(frmPurchaseDetails.txtTotal)) + Adodc2.Recordset.Fields(7)), "########0.00")
   Filter_Rs.Close
   Unload frmPesquisaNFCompra
End Sub

Problema solucionado = click no cadeado para post encerrado!!!!!!!!!
     
FKNMALTA
FRANCA
SP - BRASIL
ENUNCIADA !
Postada em 27/05/2008 15:12 hs         
Valew Ama, só que saiu apenas o 1º item da nota, corrigndo fica assim:
 
Dim lngR As Long
Dim Clone_Rs As ADODB.Recordset
Dim strFilter As String
 
Private Sub DataGrid1_DblClick()
lngR = CLng(DataGrid1.Row + 1)
On Error Resume Next
Adodc1.Refresh: Adodc2.Refresh
Set Clone_Rs = Adodc2.Recordset
Adodc1.Recordset.AbsolutePosition = lngR
strFilter = "code = '" & Adodc1.Recordset.Fields(0) & "' AND reciptno = " & Adodc1.Recordset.Fields(1)
Clone_Rs.Filter = strFilter
If Clone_Rs.EOF Or Clone_Rs.BOF Then
    Adodc2.Recordset.MoveMax
    Adodc2.Recordset.MoveNext
Else
    Adodc2.Recordset.Bookmark = Clone_Rs.Bookmark
End If
    frmPurchaseDetails.txtfornecedor.Text = DataGrid1.Columns(3)
    frmPurchaseDetails.cbocfop.Text = Adodc1.Recordset.Fields(6)
    frmPurchaseDetails.cboespecie.Text = DataGrid1.Columns(3)
    frmPurchaseDetails.cbopgto.Text = IIf(DataGrid1.Columns(4) = "0", "a Vista", "a Prazo")
    frmPurchaseDetails.txtcpf.Text = Adodc1.Recordset.Fields(7)
    frmPurchaseDetails.txtReceipt.Text = DataGrid1.Columns(1)
    frmPurchaseDetails.txtPurchaseCode.Text = DataGrid1.Columns(0)
    frmPurchaseDetails.dtpDate.Value = DataGrid1.Columns(2)
    Do While Not Adodc2.Recordset.EOF
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 0) = Adodc2.Recordset.Fields(8)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 1) = Adodc2.Recordset.Fields(4)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 2) = Adodc2.Recordset.Fields(6)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 3) = Adodc2.Recordset.Fields(5)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 4) = Adodc2.Recordset.Fields(7)
   frmPurchaseDetails.grdPurchase.TextMatrix(idxrow + 1, 5) = Adodc2.Recordset.Fields(9)
   frmPurchaseDetails.txtTotal = Format$(CCur((Val(frmPurchaseDetails.txtTotal)) + Adodc2.Recordset.Fields(7)), "########0.00")
   idxrow = idxrow + 1
   Filter_Rs.Close
   Adodc2.Recordset.MoveNext
   Loop
idxrow = idxrow - 1
   
   Unload frmPesquisaNFCompra
End Sub
De qualquer maneira muito obrigado!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!, acendeu a luz aqui
   
Página(s): 2/2     « ANTERIOR  

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