Roni Sutton
Registered User.
- Local time
- Today, 21:10
- Joined
- Oct 18, 1999
- Messages
- 68
I have the following code launching on the 'Get Focus' of one of my fields on my form. Basically, the code is to run a query and display a message box indicating whether or not there are records in the query.
Private Sub CustomerLastName_GotFocus()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset ("qryEmployeeExists")
If rs.RecordCount > 0 Then
MsgBox "There are records in the query.
You may continue", vbExclamation
Else
MsgBox "You have not been authorized to
input data. Please see system
administrator immediately.",
vbExclamation
End If
End Sub
When I the code launches at the focus, I get the following run-time error, "Run-Time Error 3061 Too few parameters. 1 Expected."
When I click on Debug, I am put on the "Set rst = dbs.OpenRecordSet("qryEmployeeExists") line. I have checked to ensure that the query exists and that it's name is indeed qryEmployeeExists.
HELP!!
Private Sub CustomerLastName_GotFocus()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset ("qryEmployeeExists")
If rs.RecordCount > 0 Then
MsgBox "There are records in the query.
You may continue", vbExclamation
Else
MsgBox "You have not been authorized to
input data. Please see system
administrator immediately.",
vbExclamation
End If
End Sub
When I the code launches at the focus, I get the following run-time error, "Run-Time Error 3061 Too few parameters. 1 Expected."
When I click on Debug, I am put on the "Set rst = dbs.OpenRecordSet("qryEmployeeExists") line. I have checked to ensure that the query exists and that it's name is indeed qryEmployeeExists.
HELP!!