No Value

  • Thread starter Thread starter Lamar
  • Start date Start date
L

Lamar

I have report which takes information from a control on a
form. However the form is base on a query. So sometimes
the query has no results and I get Error 2427 "No Value"
when I try to open the report.

Is there something I can do? Here is the code. Thanks

Private Sub Report_Open(Cancel As Integer)

If Forms![Request]![txtDate] < Now() Then
lblBYE.Visible = True

End Sub
 
Answered in m.p.a.formscoding

Private Sub Report_Open(Cancel As Integer)
Dim bShow As Boolean

With Forms![Request]
If .RecordsetClone.RecordCount > 0 Then
If !txtDate < Date() Then
bShow = True
End If
End If
End With

Me.lblBYE.Visible = bShow
End Sub
 
Back
Top