I have a database that, when it contains data, works fine. However, when the main form is first loaded to enter the very first record, it produces an error "Run Time Error 94 - Invalid Use of Null"
I have a check box in the form that when checked means that record is completed and fields in that record are locked. This operates from the forms 'Current' event.
How can I overcome this problem. I have posted some of the offending code. Is someone able to assist?
Current in Form
Private Sub Form_Current()
If Destroyed Then
DateDestroyed.Visible = True
Else
DateDestroyed.Visible = False
End If
If Me.Destroyed = True Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
End Sub
and
After Update in Check Box
Private Sub Destroyed_AfterUpdate()
If Destroyed Then
DateDestroyed.Visible = True
Else
DateDestroyed.Visible = False
End If
If Me.Destroyed = True Then
If IsNull(DateDestroyed) Then
MsgBox "Please enter the destruction date"
Me.DateDestroyed.SetFocus
End If
End If
End Sub
Any suggestions.
I have a check box in the form that when checked means that record is completed and fields in that record are locked. This operates from the forms 'Current' event.
How can I overcome this problem. I have posted some of the offending code. Is someone able to assist?
Current in Form
Private Sub Form_Current()
If Destroyed Then
DateDestroyed.Visible = True
Else
DateDestroyed.Visible = False
End If
If Me.Destroyed = True Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
End Sub
and
After Update in Check Box
Private Sub Destroyed_AfterUpdate()
If Destroyed Then
DateDestroyed.Visible = True
Else
DateDestroyed.Visible = False
End If
If Me.Destroyed = True Then
If IsNull(DateDestroyed) Then
MsgBox "Please enter the destruction date"
Me.DateDestroyed.SetFocus
End If
End If
End Sub
Any suggestions.