Dialog box with combobox selection getting an error

jleval

Registered User.
Local time
Today, 12:44
Joined
May 16, 2012
Messages
53
I have a dialog box that pops up to select a certain part number to print. In this dialog box is a combobox that has a list of my partnumbers. When I select a part number and hit the okay button I get this error:
Syntax error (missing operator) in query expression
Here is my code when I click the command button after selecting an item from the list

Dim strWhere As String

strWhere = Me.LookUpPartNumber 'name of combobox
DoCmd.OpenReport "Batch2", acViewPreview, , strWhere
DoCmd.Close acForm, "Batch", acSavePrompt
DoCmd.Close , "frmPrintDateRange"

What am I doing wrong?
 
you are missing the object type in your close statement
 
thanks I got it to work, but I am having another problem. The partnumbers in my value box seem to be doubling and tripling each time a select something. How can I stop this
 
What is its row source? It would normally be a "parts" table that had only one record for each part.
 
Thanks, I got it to work. My row source was from a query, but I changed it. I guess it was giving me every instance of the part number where the tool was measured
 
Glad you got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom