Re: RE: How to let a query omit the search key sometimes

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: [MVP] S.Clark (Steve.Clark_NOSPAM_at_FMSInc.com)
Date: 02/11/04


Date: Wed, 11 Feb 2004 10:59:48 -0500

You can use a DCount() to test the number of records, prior to opening the
form.

-- 
HTH,
Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Jeff" <anonymous@discussions.microsoft.com> wrote in message
news:66418AEE-C747-4AF1-A26A-F24AF5C356FC@microsoft.com...
> Thank you, Steve. I've solved my first problem. The method I use is I
build a Query object and set a criterion for searching. I have a query form
with a ComboBox to put in my key. As I press a CmdButton to start searching,
another result form that uses the Query object as data source is opened.
John Vinson tells me to use Forms!formname!comboname OR
Forms!formname!comboname IS NULL as my criterion and it works.
> Now I am still working on my second problem. When no record is found, the
result form is opened incompletely, that is, only a PLAIN blank form without
any label or textbox is opened and the program is down. I am trying to
execute the Query object first, if no record is found then show a message,
cancel sub and exit. If some records are found then open the result form. I
still need help.

Quantcast