Query to a form

lee_morgan

Registered User.
Local time
Today, 02:46
Joined
Mar 10, 2005
Messages
21
Any ideas as to why I can't see the fields from my query in my form biut when I use a table I can see them all??
 
Your SQL [record source] is not returning any records. When that happens the forms sometimes load blank.
 
ghudson said:
Your SQL [record source] is not returning any records. When that happens the forms sometimes load blank.

Is there anything that I can do to stop this??
 
Put this in your forms OnOpen event...

Code:
Private Sub Form_Open(Cancel As Integer)
    
    If Me.RecordsetClone.RecordCount = 0 Then
        MsgBox "There are zero records in the data source!", vbInformation, "No Records Found"
        DoCmd.Close acForm, Me.Name
    End If
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom