Why does my VB code fail?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The Following code generates Run-time Error ‘2427’, which says “You entered and expression that has no value.†The control on the report I have generated is named Received and it is a yes / no check box. What is my error?

Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Report_Open

If Received.Value = True Then
Line99.Visible = True
Line100.Visible = True
Box97.Visible = True
End If


Exit_Report_Open:
Exit Sub

Err_Report_Open:
MsgBox Err.Description
Resume Exit_Report_Open

End Sub
 
The OnOpen event is likely too early to run code that uses values of
controls; they usually haven't been created by the report yet.

Use the OnFormat event of the desired section.

--
Ken Snell
<MS ACCESS MVP>

Pup said:
The Following code generates Run-time Error '2427', which says "You
entered and expression that has no value." The control on the report I have
generated is named Received and it is a yes / no check box. What is my
error?
 
Back
Top