How do I get a form to remember the last query criteria?

R

Robyn

I have a similar question to one SteveBSKSSMCH asked on 3/8/06. I have
created a form to look up client records in two unrelated tables using LName
and FName fields. If a client is in both tables or only in the second table,
the records pop up after clicking the OK button twice. However, If the client
is only in the first table, after clicking OK twice, the name disappears from
the two unbound text boxes, and I have to type in the last and first name
again, click OK (names disappear again) type in the names a second time and
click OK in order to obtain the report.

I tried using Al Camp’s suggestion to enter AfterUpdate code in the two
boxes, but that only resulted in Name? popping up in the two fields. Is there
a way to make this form work with only one click and no extra typing?
 
J

John Vinson

I have a similar question to one SteveBSKSSMCH asked on 3/8/06. I have
created a form to look up client records in two unrelated tables using LName
and FName fields. If a client is in both tables or only in the second table,
the records pop up after clicking the OK button twice. However, If the client
is only in the first table, after clicking OK twice, the name disappears from
the two unbound text boxes, and I have to type in the last and first name
again, click OK (names disappear again) type in the names a second time and
click OK in order to obtain the report.

I tried using Al Camp’s suggestion to enter AfterUpdate code in the two
boxes, but that only resulted in Name? popping up in the two fields. Is there
a way to make this form work with only one click and no extra typing?

Care to post your code, or the SQL view of these queries? It's rather
hard to tell what you're doing, or why the form is erasing these
textboxes!

Normally I'd suggest using an unbound Form with two unbound Textboxes
- frmCrit with textboxes txtFirst and txtLast, let's say. Your Queries
could then use

=[Forms]![txtCrit]![txtFirst]

and so on as criteria; you could then have buttons on txtCrit to open
one or more Forms or Reports based on the queries.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top