By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

Acces radio buttons

P: 6
Hi,

I want to create two radio buttons which can select gender (V for man and M for women). I've read
Staring from scratch:

1. Click and turn off the Control Wizards from the menu (icon has a magician's wand and fairy dust on it)
2. Place an Option Group frame on the form; an Option Group frame, not a standard frame!
3. Place a radio button (or checkbox, your choice) on the Option Group; as said, you need to wait until the inside of the frame changes from gray to black before releasing the button
4. Repeat this until you have all your buttons in place
at this page and it worked fine but i want to create radio buttons which shows a result from a table than then i select a radio button it don't change any data in table until i press my created update button. Here is image for clearer view :):


Hope i explain my problem quit clear :) waiting for the answers as soon as possible :)
Mar 31 '10 #1

✓ answered by ADezii

Assuming your Option Group is named optGender, and your Options are Man (Option Value = 1) and Woman (Option Value = 2), in the AfterUpdate() Event of the Option Group place the following code substituting your Sub-Form and Field Names for those given:
Expand|Select|Wrap|Line Numbers
  1. Private Sub optGender_AfterUpdate()
  2. If Me![optGender].Value = 1 Then
  3.   Me![<Sub-Form Control>].Form![<Field Name>] = "Man"
  4. Else
  5.   Me![<Sub-Form Control>].Form![<Field Name>] = "Woman"
  6. End If
  7. End Sub

Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,704
Assuming your Option Group is named optGender, and your Options are Man (Option Value = 1) and Woman (Option Value = 2), in the AfterUpdate() Event of the Option Group place the following code substituting your Sub-Form and Field Names for those given:
Expand|Select|Wrap|Line Numbers
  1. Private Sub optGender_AfterUpdate()
  2. If Me![optGender].Value = 1 Then
  3.   Me![<Sub-Form Control>].Form![<Field Name>] = "Man"
  4. Else
  5.   Me![<Sub-Form Control>].Form![<Field Name>] = "Woman"
  6. End If
  7. End Sub
Mar 31 '10 #2

P: 6
Thx man that works great.
Apr 1 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.