In Access 2000 I have a form with a tab control with 3 tabs. I have a button that is supposed to check if each question on the form has been completed. The code that is under this button is below. It works for the questions on the first 2 tabs but when it gets to the questions on the 3rd tab I get the following error message "The expression you entered refers to an object that is closed or doesn't exist".
This code does work properly on another form that only has 1 tab but also fails on a third form that has 5 tabs (it fails on the 5th tab)/
I am pretty new to adding VB to Access forms so any help would be appreciated.
Here is the code
Private Sub Command199_Click()
Dim ctl As Control
On Error GoTo Err_command199
For Each ctl In Me.Controls
If IsNull(ctl) Then
MsgBox "You must enter a value into " & ctl.Controls(0).Caption & "."
ctl.SetFocus
Cancel = True
Exit Sub
End If
Next
Exit_command199:
Exit Sub
Err_command199:
MsgBox Err.Description
'MsgBox "All the data have been entered"
Resume Exit_command199
End Sub