ColinEssex
Old registered user
- Local time
- Today, 01:31
- Joined
- Feb 22, 2002
- Messages
- 9,116
Hi All
I have the following code in the OnLoad of a form.
The objective is to have the form open at the Value (from a one line table)
I get a "missing operator in expression" on the
Set rst.FindFirst StrCriteria - I can't fathom this at all.
Dim db As Database, r As Recordset, rst As Recordset, strcriteria As String
Set db = CurrentDb
Set r = db.OpenRecordset("SurnameHold")
strcriteria = r.Fields("value")
Set rst = Me.RecordsetClone
rst.FindFirst strcriteria
If rst.NoMatch Then
msgbox "None"
Else
Me.Bookmark = rst.Bookmark
End If
Can anybody help me please? I'm a bit dim today I think.
Thank you
Col
I have the following code in the OnLoad of a form.
The objective is to have the form open at the Value (from a one line table)
I get a "missing operator in expression" on the
Set rst.FindFirst StrCriteria - I can't fathom this at all.
Dim db As Database, r As Recordset, rst As Recordset, strcriteria As String
Set db = CurrentDb
Set r = db.OpenRecordset("SurnameHold")
strcriteria = r.Fields("value")
Set rst = Me.RecordsetClone
rst.FindFirst strcriteria
If rst.NoMatch Then
msgbox "None"
Else
Me.Bookmark = rst.Bookmark
End If
Can anybody help me please? I'm a bit dim today I think.
Thank you
Col