Group Frame Conditional Coding

E

Ed Leaders

I have two option buttons in a frame and need to set the value of a caption
on a label based on which of the two options are selected in the frame.

Any ideas how I would do this?

The name of the frame is fr_Transmittal_Type

The Option names are opt_Construction and opt_As_Built

opt_Construction's value is 0
opt_As_Built's value is -1
 
G

Graham Mandeno

Hi Ed

Use the option group's AfterUpdate procedure. You don't need to worry about
the option button names, because the option group (frame) will have the
value of the button which has been selected:

Private Sub fr_Transmittal_Type_AfterUpdate()
If fr_Transmittal_Type = 0 Then
MyLabel.Caption = "you chose Construction"
Else
MyLabel.Caption = "you chose As Built"
End If
End Sub

If the option group is bound to a RecordSource field, then you should also
insert:
Call fr_Transmittal_Type_AfterUpdate
in your Form_Current procedure, to set the caption appropriately as you
navigate from record to record.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top