Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch

Status
Not open for further replies.

mikeba1

Programmer
Jan 2, 2005
235
GB
I get run time error 3464 when the following code is executed on click event of a combo box with a query as its source.

' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[activityclassid] = '" & Me![Combo9] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


the activityclassid is an autonumber
the field on the form is not visible

I have used this code on other DB's and it works fine

Any help greatly appreciate



 

If "the activityclassid is an autonumber", why do you put quotes around it?

[tt]
rs.FindFirst "[activityclassid] = [red]'[/red]" & Me![Combo9] & "[red]'[/red]"
[/tt]


Have fun.

---- Andy
 
All of that code can simply be written as:
Me.Recordset.FindFirst "[activityclassid] = " & nz(Me.Combo9,0)

The rest is superfulous
 
Thanks guys.
I cannot see the woods for the trees.
 
mikeba1,
If you really want to thank MajP and/or Andy, you should click the link "Like this post? Star it!" This both gives credit to those providing the answer and lets us know your question has been answered ;-).

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top