
Originally Posted by
bcmarshall
I realize this is a very old thread, but I just stumbled upon it and it appears that there was no resolution offered. Actually, what you wanted to do is quite simple to accomplish, without code or anything else.
In the criteria line of the query for each of the two fields in question, order_id and L4ID, just enter the following:
Like [Whatever message you want to be displayed as the box opens]
The text within square brackets will be displayed as the prompt, and a box asking for the information to be manually input will be automatically generated. If you have two similar criteria lines than there will be two boxes that open, one after the other.
Now when you open the form, of course the query will run and the boxes will appear. What happens in a query if there are no results to return? You get an empty recordset, of course. And the form which is based on that query will open with a blank record.
What happens when you open a query where there are matching records? Of course that recordset will be returned, and when the form is based on that query, the form will open with matching records as well.
You shouldn't need to do a thing more than what I've outlined. Boxes will come up, and the form will either open to a blank, new record or it will open to the existing record(s) you're seeking.
Sorry about the late reply. Hope it helps.