Recordset query

bhuttak

New member
Local time
Today, 02:48
Joined
Feb 9, 2006
Messages
5
Good Morning,

I have little problem, I hope One of You Master can solve very fast. Thanks

Dim SqlInv As String
Dim cn As ADODB.Connection
Dim UPD_Invoice As ADODB.Recordset

Set cn = CurrentProject.AccessConnection
Set UPD_Invoice = New ADODB.Recordset

SqlInv = "SELECT [Invoice-Tb].Repl_Invoice, [Invoice-Tb].InvoiceNo" & _
"FROM [Invoice-Tb] " & _
"WHERE ((([Invoice-Tb].InvoiceNo)= Me.Invoice_No))"

UPD_Invoice.Open (SqlInv), cn, adOpenDynamic

With UPD_Invoice
.Update
!Repl_Invoice = R_Inv_No
.Update
End With
UPD_Invoice.Close
 
What exactly is your problem, what is the query going to do.

Alastair
 
Let me just take a guess!
Code:
Dim SqlInv As String
Dim cn As ADODB.Connection
Dim UPD_Invoice As ADODB.Recordset

Set cn = CurrentProject.AccessConnection
Set UPD_Invoice = New ADODB.Recordset

SqlInv = _
"SELECT [Invoice-Tb].Repl_Invoice, [b][Invoice-Tb].InvoiceNo " & _[/b]
"FROM [Invoice-Tb] " & _
"WHERE (([Invoice-Tb].InvoiceNo)= [b]" & Me.Invoice_No & "[/b]))"

UPD_Invoice.Open SqlInv, cn, adOpenDynamic

With UPD_Invoice
' .Update
!Repl_Invoice = R_Inv_No
.Update
End With
UPD_Invoice.Close
cn.Close
[b]Set UPD_Invoice = Nothing
Set cn = Nothing[/b]
 

Users who are viewing this thread

Back
Top Bottom