Re: Test for no records returned

From: tina (nospam_at_address.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 03:58:12 GMT

that's the (easier) one i didn't know - thanks, Cheryl! :)

"Cheryl Fischer" <cherylfischer@NOSPAMmsn.com> wrote in message
news:%23SPOQylLEHA.2532@TK2MSFTNGP10.phx.gbl...
> To add to Tina's post, if you want to test a query being used as the
Record
> Source of a form, you can put the following code in the Open event of the
> form:
>
>
> If Me.RecordsetClone.RecordCount = 0 Then
> MsgBox "There are no records to review."
> Cancel = True
> End If
>
> If there are no records in the query, the form does not open and the
message
> box is displayed for the user.
>
> --
>
> Cheryl Fischer, MVP Microsoft Access
> Law/Sys Associates, Houston, TX
>
>
> "Brian C" <anonymous@discussions.microsoft.com> wrote in message
> news:640d01c42e42$3f3195f0$a301280a@phx.gbl...
> > If I run a select query that may return no records how do
> > I test that there are no records?
> >
> > I need to do this in code, i.e.code a select statement
> > followed by the test. Thanks in advance.
>
>



Relevant Pages

  • Re: Append problem
    ... Cheryl Fischer, MVP Microsoft Access ... "Basil" wrote in message ... > The code you suggested gives me the error "Query input must contain at least one table or query." ... > Cheryl Fischer, MVP Microsoft Access ...
    (microsoft.public.access.queries)
  • Re: Append problem
    ... The code you suggested gives me the error "Query input must contain at least one table or query." ... How can I do this without having the [mee] table there? ... Cheryl Fischer, MVP Microsoft Access ...
    (microsoft.public.access.queries)
  • Re: Exporing Numbers from a query
    ... Thank You Cheryl but I am still confused on where to put ... Chris ... >query using either of these functions was exported to ... I tried making changes in the ...
    (microsoft.public.access.externaldata)
  • Re: OT Kinda - BIG Thanks to Heidi
    ... Cheryl in Oz wrote: ... query to Amazon in Germany. ...
    (rec.crafts.textiles.quilting)
  • Re: using <= and >= in an expression
    ... "Cheryl" wrote in message ... > meals allowed per shift hours worked. ... > I created a query that returns the hours worked and am now ...
    (microsoft.public.access.queries)