Re: Test for no records returned
From: Cheryl Fischer (cherylfischer_at_NOSPAMmsn.com)
Date: 04/30/04
- Next message: gene: "Re: Help!! Problem with query"
- Previous message: gene: "Re: Help!! Problem with query"
- In reply to: Brian C: "Test for no records returned"
- Next in thread: tina: "Re: Test for no records returned"
- Reply: tina: "Re: Test for no records returned"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 21:40:51 -0500
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.
- Next message: gene: "Re: Help!! Problem with query"
- Previous message: gene: "Re: Help!! Problem with query"
- In reply to: Brian C: "Test for no records returned"
- Next in thread: tina: "Re: Test for no records returned"
- Reply: tina: "Re: Test for no records returned"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|