-
1
- #1
Can anyone tell me why the code hangs at the "set rstAdmin = OpenRecordset, etc. line with a Type Mismatch error? I have looked at examples and can't find the problem. Here is the code:
Private Sub Command2_Click()
Dim db As Database
Dim rstAdmin As Recordset
Dim PSID As String
' Value passed from open form
PSID = Forms!Form1!Text0
Set db = CurrentDb()
Set rstAdmin = db.OpenRecordset("tblAdmin", dbOpenDynaset)
rstAdmin.Find PSID, , adSearchForward
If IsMissing(PSID) Then MsgBox "Nope" _
Else: MsgBox PSID & " found"
End Sub
Thanks for any help!
Private Sub Command2_Click()
Dim db As Database
Dim rstAdmin As Recordset
Dim PSID As String
' Value passed from open form
PSID = Forms!Form1!Text0
Set db = CurrentDb()
Set rstAdmin = db.OpenRecordset("tblAdmin", dbOpenDynaset)
rstAdmin.Find PSID, , adSearchForward
If IsMissing(PSID) Then MsgBox "Nope" _
Else: MsgBox PSID & " found"
End Sub
Thanks for any help!