11-04-13, 19:26 #1Registered User
- Join Date
- Mar 2004
Unanswered: Access 2003 Error "Invalid Use Of Null"
Where is the null error?
The highlighted line in the debuggers is the line that starts with photocount =
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) Dim i As Integer, photocount As Integer Dim strImage As String, strPath As String, mlsno As String ' set count of number of photos photocount = IIf([TotalPhotoCount] > 9, 9, [TotalPhotoCount]) (error highlights this line) mlsno = [ListingID] ' load images from disk For i = 1 To photocount strImage = "imgPicture" & i strPath = "f:\mlspresentationdata\Photo" & mlsno & "-" & i & ".jpg" If Dir(strPath) <> "" Then Me.Controls(strImage).Picture = strPath Me.Controls(strImage).Visible = True Else Me.Controls(strImage).Visible = False End If Next ' make remining images invisible For i = photocount + 1 To 9 strImage = "imgPicture" & i Me.Controls(strImage).Visible = False Next EndSub
11-04-13, 19:44 #2Resident Curmudgeon
Provided Answers: 54
- Join Date
- Feb 2004
- In front of the computer
I'd wager that TotalPhotoCount is NULL when that line gets evaluated.
-PatPIn theory, theory and practice are identical. In practice, theory and practice are unrelated.