Option group validation

teiben

Registered User.
Local time
Today, 22:24
Joined
Jun 20, 2002
Messages
462
I have an option group, with two options buttons. I need to to be a required field. (I cant) make this required at the table level, as there are already 56K records).

I've tried on the before update on the form, making the frame tag = required. For some reason this is not working. Any idea's

Dim blnContinue As Boolean
Dim ctl As Control
blnContinue = True
For Each ctl In Me.Controls
If ctl.Tag = "Required" Then
If IsNull(ctl) Then
MsgBox "Required Information Missing", vbCritical + vbOKOnly + vbDefaultButton1, "You must fill in the field indicated with red"
Cancel = True
ctl.SetFocus
Exit For
End If
End If
Next ctl
Set ctl = Nothing
End Sub
 
Forgot to mention the form is continous, this probably matters.
 
any other ideas? I can't run an update query on the existing 56K records, as a field was added indicating process, which I don't know, therefore I can't create the validation at the table level.

I've tried playing around w/lines such as

f Me.Frame48 = 0 And IsNull Then
MsgBox "You must select a process"
Cancel = True
End If

End Sub

I'm getting various errors. This code is on a subform, would this make a difference?
 

Users who are viewing this thread

Back
Top Bottom