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!

RUN TIME ERROR (2185)

Status
Not open for further replies.

philipmck

Technical User
Jul 30, 2008
21
EU
When i run the program i get a run time error "2185" for the below code.

error message:

you cant reference a property or method for a control unless the control has the focus

\\VB CODE//

If Me.ProcessCombo.Text = "...." & Me.Option1Combo.Text = "...." & Me.Option2Combo.Text = "..." Then Me.SEARCH.Caption = "...."
 
Thanks that has worked.

Also I wonder if you could help me with this.

I have 3 combo boxes. the user selects information out of all 3 but depending on what you click in for instance combo 1 depends what is seen on combo 2. the idea is that when the user clicks on the "search" button that it takes the 3 selected bits of information and matches them to the correct bit of coding ie

If Me.ProcessCombo = "the" & Me.Option1Combo.Text = "son" & Me.Option2Combo = "moved" Then Me.SEARCH.Caption = "55"

the search button would then insert 55 into a text field which is not visible and would then search the database for "55".

i hope this is understandable
 
i hope this is understandable

Not quite. What bit are you stuck on?
 
i need to create a query that reads what is in text43 (name of text field) and searches the database for the information that is contained in the field
 
Anyway, & is the string concatenation operator, not a boolean AND operator.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can do this with VBA or the query design window. You can refer to a form on the criteria line like so:

=Forms![InsertFormNameHere]!Search.Caption
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top