Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameter Question (2003)

    I have a query parameter which displays feedback on my form. I'm wondering if it is possible to put a validation on the query if it returns no results to display a message like "No Results Returned"? At the moment, it just displays a blank form. Thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Parameter Question (2003)

    You can put code in the On Open event of the form bound to the parameter query:

    Private Sub Form_Open(Cancel As Integer)
    If Me.RecordsetClone.RecordCount = 0 Then
    MsgBox "No results returned!", vbInformation
    Cancel = True
    End If
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •