G
Guest
The idea of the code is to make a self-updating combo box and it works just
fine until I want to change the entry back to Null.
Then I get Run time error 94 – Invalid use of Null.
This is the code:
Private Sub CboFloor_BeforeUpdate(Cancel As Integer)
Dim strFloor As String
strFloor = Me.CboFloor
If DCount("Floor", "Participant Pool", "Floor = '" & strFloor & "'") = 0
Then
If MsgBox(strFloor & " is not currently in the Floor list, would you
like to add it?", vbYesNo, "Add Floor?") = vbNo Then
Cancel = True
Me.CboFloor.Dropdown
End If
End If
End Sub
Is there a line of code I can add in to remove my problem?
Any help is greatly appreciated.
Mary
fine until I want to change the entry back to Null.
Then I get Run time error 94 – Invalid use of Null.
This is the code:
Private Sub CboFloor_BeforeUpdate(Cancel As Integer)
Dim strFloor As String
strFloor = Me.CboFloor
If DCount("Floor", "Participant Pool", "Floor = '" & strFloor & "'") = 0
Then
If MsgBox(strFloor & " is not currently in the Floor list, would you
like to add it?", vbYesNo, "Add Floor?") = vbNo Then
Cancel = True
Me.CboFloor.Dropdown
End If
End If
End Sub
Is there a line of code I can add in to remove my problem?
Any help is greatly appreciated.
Mary