Missing operator error (1 Viewer)

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

:(
 

RichMorrison

Registered User.
Local time
Yesterday, 19:31
Joined
Apr 24, 2002
Messages
588
Colin,

The value you put in strcriteria should be an expression of the form:
"[FieldName]=SomeValue"

HTH,
RichM
 

ColinEssex

Old registered user
Local time
Today, 01:31
Joined
Feb 22, 2002
Messages
9,116
Thats great Rich - it works fine now

Much appreciated

Col
 

Users who are viewing this thread

Top Bottom