afterupdate code

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
 
J

John Spencer (MVP)

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")) & "'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Search combo box 2
Textbox Filter 4
OnLoad event criteria 7
RunTime Error 3070 11
runtime error 13 2
Error 2237 8
Combo Box recordset problem 2
Load event - multiple criteria 0

Top