syntax error missing operator 3077

A

Alfred FPC

I am receiving the run-time error when i go delete one field and go to
anoher. i have 3 text boxes that i use to search a table and i use the
flowing code:

Sub Combo42_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PROPERTY_ID] = " & Me![Combo42]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

it works most of the time but like i said earlier when i delete one field
(property ID) and i click on another search field (serial number) it gives me
the run-time error. Is there something wrong with the code??
 
A

Andi Mayer

I am receiving the run-time error when i go delete one field and go to
anoher. i have 3 text boxes that i use to search a table and i use the
flowing code:

Sub Combo42_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PROPERTY_ID] = " & Me![Combo42]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

it works most of the time but like i said earlier when i delete one field
(property ID) and i click on another search field (serial number) it gives me
the run-time error. Is there something wrong with the code??

it tries to find the value in combo42 and this value is deleted,
therefore it doesn't find it and goes to EOF

EOF is not a valid bookmark therefore:

with Me.RecordsetClone
.FindFirst "[PROPERTY_ID] = " & Me![Combo42]
if not .nomatch then Me.Bookmark = .Bookmark
end with
 
Top