I use this code in a form to load a image from several based on the value of fldDiagName.
Option Compare Database
Option Explicit
Dim srcdoc1 As String
Private Sub Report_Load()
If IsNull([fldDiagName].Value) Then
srcdoc1 = DLookup("[tblBobbinDiagrams]![Diag Path & File]", "tblBobbinDiagrams", "[Bobbin Diag Type]='BLANK'")
Else
srcdoc1 = DLookup("[tblBobbinDiagrams]![Diag Path & File]", "tblBobbinDiagrams", "[Bobbin Diag Type]=[fldDiagName]")
End If
Diagram1Image.Picture = srcdoc1
Diagram2Image.Picture = srcdoc1
End Sub
When the report loads I get run time error '94', Invalid Use of Null.
Should I be put the event after the report has loaded?
If so where?