Checking for empty query

  • Thread starter Thread starter Bert nErnie via AccessMonster.com
  • Start date Start date
B

Bert nErnie via AccessMonster.com

I have a query that uses a master table. The criteria in the query is to request to the user a last name using [enter last name]. I have a form that uses this query for it's source. When I run the form it requests the last name and works fine when the name is in the table but if the name isnt in the table a blank form comes up. I am a newbie and would appreciate any help to get this form to react a name that is not in the table instead of showing a blank form.
Thanks in advance.
 
You are currently using the [enter last name] prompt in your query as a
parameter. This forces the user to "guess" correctly on the name.

Another approach is to add a combobox to the form you use to display what's
found. The combobox would be unbound, and would have, as a source, all
valid last names. In the combobox's AfterUpdate event, requery the form.

Your query would be modified to look for its parameter on the form, in the
combobox, not ask for input.

With this approach, the user is assured of only selecting valid last names.

--
Good luck

Jeff Boyce
<Access MVP>

Bert nErnie via AccessMonster.com said:
I have a query that uses a master table. The criteria in the query is to
request to the user a last name using [enter last name]. I have a form that
uses this query for it's source. When I run the form it requests the last
name and works fine when the name is in the table but if the name isnt in
the table a blank form comes up. I am a newbie and would appreciate any
help to get this form to react a name that is not in the table instead of
showing a blank form.
 
Back
Top