Struggling with a Search Form

jsnyde57

New member
Local time
Today, 11:47
Joined
Jan 2, 2013
Messages
5
Hello All,

I created a Searchform that is working beautifully to search through my tables and find the data and displays in a list box. The problem that I am running into is that my double click to open a form is not working. I currently have the code written as

DoCmd.OpenForm "ProvidersF", , , "Provider ID= " & Me.ProviderList

When I double click on the record I want to open in my other form I get Syntax error (missing operator) in query expression 'Provider ID=3', which is a true statement. I have checked out the baldry web page, but I still can't get it to work.

Any thoughts?
 
I get Syntax error (missing operator) in query expression 'Provider ID=3', which is a true statement.

The column name itself needs to be wrapped in quotes itself to get passed into the query engine as the column has a space. The quotes you have merely are concatenating the entire string together.

I am not sure which quote character would be the correct one. I would try the Double Quote character first, which would be Chr(34) to get that embedded into the string. So perhaps something like:

Code:
Chr(34) & "Provider ID" & Chr(34) & "= " & Me.ProviderList
 
My other form opens now, but it doesn't take me to the correct record. It does get me one step closer.
 
I never make use of that OpenForm WhereCondition arg, so someone else will have to step in.
 
I try not to name fields with spaces in them - too easy to get errors.
try DoCmd.OpenForm "ProvidersF", , , "[Provider ID]= " & Me.ProviderList

i will check similar code when i get home but try that.

.
 
That works perfect. Thank you so much. Been pounding my head against the wall for awhile on this.
 

Users who are viewing this thread

Back
Top Bottom