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

parameter query message box problem

Status
Not open for further replies.

Xzibit7

Technical User
Jun 20, 2006
172
US
I have two criteria that are or'ed together in a parameter query. My problem is I get two message boxes when
I run the form and I only want to get one message from each individual form. I have tried to use sendkeys "{enter}" and tab to automatically press enter on the first message box but it is not active with the macro. How do I get these message boxes not to display?
 
So you have:

SELECT * FROM SomeTable WHERE Something = [Please enter something] OR Nothing = [Please enter nothing]

and you get prompted twice for each one?

What is the macro you are trying to run with the query?



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 

If you have two parameters then you will see two input boxes (not message boxes.) The usual approach is to place controls such as text boxes, list boxes or combo boxes on your form and use those as the source of parameter values rather than parameters built into the query.

Why would you want to automatically close one of the input boxes? If you were successful then the user wouldn't be able to supply the parameter and that would seem to be the whole point of having them.
 
Thanks for the reply, sorry my question was rather vague.
Here's the deal:

- I have one form that shows a list of parts. I want to be able to click on the part and then information about that part comes up.

- I have another form that I want the user to input the part number and that part information comes up

- The parameter query I have set up is ored for both these criteria

- My problem is the message box shows up for both in either circumstance. I can get the data I want but would like to get rid of the unnecesary message boxes. I have tried just use sendkey in a macro to press tab then enter (thus getting rid of the first messagebox)...This however only tabs and enters after something as been entered into the message boxes in my part information form.


 
so you are using the same query as the record source for two different forms?
 
Yes.I guess I could just make a seperate information query/form for each. I know that would solve my problem but was hoping there was a more efficient approach
 
Why not have a Part Information Form? Have both the drop down list and a part number edit box. If the user has selected from the dropdownlist use that, if they enter the part number use that

DropDownList Enter Part Number : [ ]

Reference the controls on the form in your query (in my example above you would replace [Please enter something] with frmPartInfo.DropDownList (that syntax may not be quite right, but that's the idea)

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Unfotunately, I have to use two forms (maybe even more). The list of part numbers that a user can click on comes from a query of open projects. There are also other forms like assignee and program that I might make into selectable part numbers that I would like to get the information from. I also still need the user just to be able to look up by typing in the part number, because there will be so many. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top