J
Jason V
I had this question posted already but never finalized a solution:
I am trying to look up a "CWA Number" from tblLabourTransaction using a
unique Reference Number as criteria. "txtAssRefNumber" is an unbound object
where the user enters the reference number to be searched.
In other words, the user enters the reference number, triggers the event,
and Access returns the CWA Number associated with it from
tblLabourTransaction.
I am getting the following error: "No value given for one or more required
parameters." This is what I have:
Dim s As String
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set db = CurrentProject.Connection
s = "SELECT * FROM tblLabourTransaction WHERE
tblLabourTransaction.Reference_Number = " & Me.txtAssRefNumber & ";"
Set rs = New ADODB.Recordset
rs.Open s, db, adOpenStatic, adLockOptimistic
Me.txtCWANumber = rs.Fields("CWA Number")
Set rs = Nothing
Set db = Nothing
The error is occrring in this line:
rs.Open s, db, adOpenStatic, adLockOptimistic
Any ideas?
I am trying to look up a "CWA Number" from tblLabourTransaction using a
unique Reference Number as criteria. "txtAssRefNumber" is an unbound object
where the user enters the reference number to be searched.
In other words, the user enters the reference number, triggers the event,
and Access returns the CWA Number associated with it from
tblLabourTransaction.
I am getting the following error: "No value given for one or more required
parameters." This is what I have:
Dim s As String
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set db = CurrentProject.Connection
s = "SELECT * FROM tblLabourTransaction WHERE
tblLabourTransaction.Reference_Number = " & Me.txtAssRefNumber & ";"
Set rs = New ADODB.Recordset
rs.Open s, db, adOpenStatic, adLockOptimistic
Me.txtCWANumber = rs.Fields("CWA Number")
Set rs = Nothing
Set db = Nothing
The error is occrring in this line:
rs.Open s, db, adOpenStatic, adLockOptimistic
Any ideas?