BlueJacket
Registered User.
- Local time
- Today, 11:50
- Joined
- Jan 11, 2017
- Messages
- 92
I'm having trouble with figuring out how to check if a column in a listbox is null or not.
Any help? I know the listbox columns start at 0 and a ?Me![lboMainSearchResults].Column(4) in the immediate pane does get me the results I want.
Thanks in advance.
Code:
Private Sub butOpenServiceChart_Click()
If gEnableErrorHandling Then On Error GoTo Errhandle
Dim stDocName As String
Dim stQTRecord As String
stDocName = "frmServiceChart"
stQTRecord = "[PropertyID]=" & Me![lboMainSearchResults]
If IsNull(Me![lboMainSearchResults].Column(4)) Then
MsgBox "There is no case number associated with this property. You must create a new case" & _
vbCrLf & " before you can edit the service chart."
Else
DoCmd.OpenForm stDocName, , , stQTRecord
End If
Exit Sub
Errhandle:
Select Case Err
Case 3075
MsgBox "Select a record you want to edit."
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description & _
vbCrLf & "Please make a note of this error and when it occured." & _
vbCrLf & " " & FormatDateTime(Now(), vbGeneralDate)
End Select
End Sub
Any help? I know the listbox columns start at 0 and a ?Me![lboMainSearchResults].Column(4) in the immediate pane does get me the results I want.
Thanks in advance.