Are you using
query parameters to prompt the user or controls on a form? If you're using query parameters, there is no way to accomplish this; judging by your post above, it sounds like you are indeed using query parameters. Almost everyone here would suggest running queries from a form when you want to prompt the user for parameters. It takes a little extra effort, but adds much more flexibility.
Create a new, unbound form.
Add text boxes, name and lable accordingly (these are for the data that will be passed through to your query).
Add a command button that will be used to open the query. The code behind your command button should be something like this:
Code:
Private Sub cmdOK_Click()
Dim strQueryName as String
strQueryName = "" 'Enter your query name here
DoCmd.OpenQuery strQueryName, acViewNormal
End Sub
Now for the query, instead of having prompts with the brackets []'s, you'll want to reference the controls on your form. In the design grid, for example, under the column where you're asking for part number, type in
Forms![YourFormName]![YourControlName].
As long as [YourFormName] is open, the query will take whatever the user has typed in [YourFormName]![YourControlName] and use that as criteria!
To keep things simple for your data verification, you can do a DLookUp function in code behind your text box. Test to see if that DLookUp evaluates to false, then prompt the user with a messagebox. If you need further help with the DLookup and Msgbox functions, let me know!
~Melagan
______
"It's never too late to become what you might have been.