Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating frames, how??

Status
Not open for further replies.

uttam1

Programmer
Joined
Aug 8, 2003
Messages
9
Location
IN
Hi all,

One more problem, I have a frame with 2 option buttons ( radio buttons )There is no default value. I want to validate the frame and make sure a value is selected before it enters the database. Each option's have index's 1 and 2. How do I do this?

Thanks in advance,
Uttam
 
Just check the frame to see if it's null:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrHandler
  If IsNull(Me.fraOptions.Value) Then
    MsgBox "Please choose an option"
    Cancel = True
  End If
ExitHere:
  Exit Sub
ErrHandler:
  Debug.Print Err; Err.Description
  Resume ExitHere
End Sub

VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top