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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CODE TO CHECK IF OPTION BUTTON IS ACTIVE OR NOT IN A VB MODULE 1

Status
Not open for further replies.

Gemini07306

Technical User
Jun 25, 2003
15
US
HELP PLEASE!!!
I CREATED AN ACCESS FORM WITH CONTROLS(TEXT BOXES, COMBO BOXES AN OPTION BUTTON AND A COMMAND BUTTON)

WHEN THE USER CLICKS ON THE COMMAND BUTTON TO BEGIN PROCESS, I WANT A ROUTINE TO GENERATE A "MSGBOX" MESSAGE TO CHECK IF THE "OPTION BUTTON" IS CLIKED.

EXAMPLE: IF OPTION BUTTON IS CLICKED THEN
MSGBOX "CONTINUE PROCESS"
ELSE
MSGBOX "GO BACK AND CLICK THE OPTION BUTTON"
EXIT SUB
END IF.

PLEASE RESPOND TO tgifgemini@yahoo.com or gixtian@nyct.com

THANKS A MILLION TO ALL OR YOU.
GEMINI07306


 
THERE IS NO NEED TO SHOUT (capital letters)

[tt]If (Me!NameOfOptionButton.Value = True) Then[/tt]

The way it ususally work here, is that someone post an answer here, not send e-mails.

Should this be an option button within an option group, you'd need to check the value of the group (frame)

Roy-Vidar
 
Tradition also says that there is no need to say that the value = true.

Code assumes that if the field has only 2 states (True/False, Yes/No, 0/1) then if you say me.field with no value then it knows you mean True.

Other examples of this are:

If isnull(me.field) then ' no need to say True

If rst.eof then ' no need to say True

Hope that gives you some more knowledge

If at first you don't succeed, try for the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top