I have a combobox and 3 textboxes. THe 3 textboxes are populated depending on the number in the combobox. I keep getting the INVALID USE OF NULL error when the combo box receives the focus and then the user tabs to the next box without entering a number. But I want the user to be able to do this. Here is my code:
Private Sub Employee_Exit(Cancel As Integer)
If IsNull(Employee) Then Exit Sub
Dim strName As String
Dim strShift As String
Dim strDept As String
strName = [Employee].Column(1) <---error is here when I
txtname = strName debug
strShift = [Employee].Column(2)
txtshift2 = strShift
strDept = [Employee].Column(3)
txtjob = strDept
End Sub
I thought the If isnull at the beginning would eliminate error but it doesn't. How can I avoid NULL error?
Private Sub Employee_Exit(Cancel As Integer)
If IsNull(Employee) Then Exit Sub
Dim strName As String
Dim strShift As String
Dim strDept As String
strName = [Employee].Column(1) <---error is here when I
txtname = strName debug
strShift = [Employee].Column(2)
txtshift2 = strShift
strDept = [Employee].Column(3)
txtjob = strDept
End Sub
I thought the If isnull at the beginning would eliminate error but it doesn't. How can I avoid NULL error?