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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wrong data type 2

Status
Not open for further replies.

AQHA

Technical User
Apr 5, 2007
7
US
When I run this, I get
An expression you entered is the wrong data type for one of the arguments.


Private Sub Select_Exhibitor_DblClick(Cancel As Integer)
On Error GoTo Select_Exhibitor_DblClick_Err
DoCmd.SelectObject acForm, "Exhibitors"
DoCmd.GoToControl "LastName"
DoCmd.FindRecord Forms![Exhibitor Search]![Select Exhibitor], acEntire, False, acDown, False, acCurrent
DoCmd.Close acForm, "Exhibitor Search"

Select_Exhibitor_DblClick_Exit:
Exit Sub

Select_Exhibitor_DblClick_Err:
MsgBox Err.Description
Resume Select_Exhibitor_DblClick_Exit

End Sub
 
Try

DoCmd.FindRecord '" & Forms![Exhibitor Search]![Select Exhibitor] & "', acEntire, False, acDown, False, acCurrent
 
I am now getting
Compile error:
Argument not optional
The . FindRecord is highlighted
 
The first single quote makes VB think everything after FindRecord is a comment. I don't think you need quotes at all, this should suffice:

DoCmd.FindRecord CStr(Forms![Exhibitor Search]![Select Exhibitor]), acEntire, False, acDown, False, acCurrent



 
Thanks to both Savil & JoeAtWork...problem solved
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top