Hi,
I have a subform with numerous data validation rountines attached to the On Exit events of the controls. They do exactly what I want them to do, but I started to get errors that referred to these On Exit events when I returned to the main form and tried to go to a new record. For example, this is the code from one of my controls:
Private Sub WallAngleLength_Exit(Cancel As Integer)
If IsNull(WallAngleLength) Then
MsgBox "Wall Angle Length must be selected"
WallAngleLength.SetFocus
Cancel = True
Else
If GuideDrawingNum = "400106" Or GuideDrawingNum = "400108" Then
MiddleAngleLength.Enabled = False
OutsideAngleLength.Enabled = False
End If
End If
End Sub
Once the subform is completed and all controls are completed properly, I move back to the main form. At this time, when I attempt to move to a new record I begin to get message box "Wall Angle Length must be selected". It may pop up 4 or 5 times before it allows me to enter data into the new main form record. The msgbox that pops up doesn't always reference the same control from the subform, it is very erratic.
Any ideas as to why this is occuring?
Thanks
Kenton
I have a subform with numerous data validation rountines attached to the On Exit events of the controls. They do exactly what I want them to do, but I started to get errors that referred to these On Exit events when I returned to the main form and tried to go to a new record. For example, this is the code from one of my controls:
Private Sub WallAngleLength_Exit(Cancel As Integer)
If IsNull(WallAngleLength) Then
MsgBox "Wall Angle Length must be selected"
WallAngleLength.SetFocus
Cancel = True
Else
If GuideDrawingNum = "400106" Or GuideDrawingNum = "400108" Then
MiddleAngleLength.Enabled = False
OutsideAngleLength.Enabled = False
End If
End If
End Sub
Once the subform is completed and all controls are completed properly, I move back to the main form. At this time, when I attempt to move to a new record I begin to get message box "Wall Angle Length must be selected". It may pop up 4 or 5 times before it allows me to enter data into the new main form record. The msgbox that pops up doesn't always reference the same control from the subform, it is very erratic.
Any ideas as to why this is occuring?
Thanks
Kenton