ThunderBolt
Registered User.
- Local time
- Today, 22:42
- Joined
- Apr 29, 2003
- Messages
- 25
I am fustrated by this section of code. I keep receiving the following error message when attempting to run the following code:
Private Sub Confirmbutt_Click()
Dim Db As Database
Dim R As Recordset
Set Db = CurrentDb()
Set R = Db.OpenRecordset("propertyIDSearch")
Me![PropertyID] = R(0)
R.Close
End Sub
Error message:
"Run-Time error 3061
Too few parameters. Expected 2."
PropertyIDSearch is the name of a query.
PropertyID is the name of a text box on my form
(Im trying to place the first and only value from the query into the text box)
Any help on why things are not working would be much appreciated. I feel it has something to do with an incorrect declaration of a recordset??
regards,
Thunderbolt
Private Sub Confirmbutt_Click()
Dim Db As Database
Dim R As Recordset
Set Db = CurrentDb()
Set R = Db.OpenRecordset("propertyIDSearch")
Me![PropertyID] = R(0)
R.Close
End Sub
Error message:
"Run-Time error 3061
Too few parameters. Expected 2."
PropertyIDSearch is the name of a query.
PropertyID is the name of a text box on my form
(Im trying to place the first and only value from the query into the text box)
Any help on why things are not working would be much appreciated. I feel it has something to do with an incorrect declaration of a recordset??
regards,
Thunderbolt