G
Guest
I use this technique in another database every day but it won't work in this
one so I set up a test
Private Sub Command1_Click()
Dim db As Database
Dim r As Recordset
Dim strx As String
Set db = CurrentDb
strx = DLookup("Firstname", "Participants", "[FamID]=51")
MsgBox strx
Set r = db.OpenRecordset("SELECT FirstName FROM Participants WHERE FamID=51")
End Sub
The Dlookup works fine but the OpenRecordset gives me this error
Run-time error '13':
Type mismatch
I have checked References and can't find anything wrong.
Any ideas please?
Stephen
one so I set up a test
Private Sub Command1_Click()
Dim db As Database
Dim r As Recordset
Dim strx As String
Set db = CurrentDb
strx = DLookup("Firstname", "Participants", "[FamID]=51")
MsgBox strx
Set r = db.OpenRecordset("SELECT FirstName FROM Participants WHERE FamID=51")
End Sub
The Dlookup works fine but the OpenRecordset gives me this error
Run-time error '13':
Type mismatch
I have checked References and can't find anything wrong.
Any ideas please?
Stephen