By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,477 Members | 1,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,477 IT Pros & Developers. It's quick & easy.

Open form based on Query

P: n/a
Is there a way to open a form based on query type.. Example..

If a certain query result is 1 then open the form to this result..

If the query results are NULL or 0 results, then open open for in add
or add new record form.

The query will return one to 0 records so this is my option. Im
guessing the form load event would be the place but not sure how to go
about it.

thanks,

Dave

Dec 20 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
st********@hotmail.com wrote:
Is there a way to open a form based on query type.. Example..

If a certain query result is 1 then open the form to this result..

If the query results are NULL or 0 results, then open open for in add
or add new record form.

The query will return one to 0 records so this is my option. Im
guessing the form load event would be the place but not sure how to go
about it.
The OpenForm method has an optional WHERE argument that can be used to apply
a filter to a form as it is opened. All you need to do is use that method
(behind a button for example) to open your form while applying a filter to
see the record you want. If zero records satisfy the filter the form will
opened in "Add" mode.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.