afterupdate code

  • Thread starter Thread starter leon
  • Start date Start date
L

leon

I put the undermentioned code in the after_update event of a combobox.
However this does not work. I get a tyoe mismatch eror. This is most
probably due to the fact that [naam] is a text value and not a number.
Only thing is i don't know what i have to change in the code to make
it work. Any ideas are more than welcome.

Set rs = Me.Recordset.Clone
rs.FindFirst "[naam] = " & Str(Nz(Me![Combo0], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
Surround the string value with quote marks - Chr(34) - or with apostrophes.

rs.FindFirst "[naam] = " & Chr(34) & Str(Nz(Me![Combo0],"0")) & Chr(34)
or
rs.FindFirst "[naam] = '" & Str(Nz(Me![Combo0],"0")) & "'"
 
Back
Top