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

Option Group

Status
Not open for further replies.

demon147

Technical User
Jun 29, 2001
30
0
0
CA
I want to add an option group control to a form and be able to assign the same value to two of the answers but access will not allow me to assign the same value to answers within the same group. Is there any way to do this.


Help Appreciated.
 
Well, my first impulse is to ask 'Why do you need to assign the same answer to 2 different options?' Do you really need both options if the answer is the same?

On the other hand, I think I may see where you're coming from. We have a form (not Access) with something similiar in our company. We've given health questionnaires to people and one of the questions is:
Have you ever been told you have diabetes?
A) Yes (Yes stored in database)
B) No (No stored in database)
C) Only when pregnant (No stored in database)

In this case option B and C store the same answer.

If you really need the same answer twice in your option group then create an unbound option group with different answers for each option and then write some VBA code in the click event of the group to update an invisible text box bound to your table field with the appropiate value base on the option clicked.

For example, user clicks option group with 4 choices whose values are 1,2,3 and 4
Select Case me!optiongroup
Case 1
me![text] = "answer A"
Case 2
me![text] = "answer B"
Case 3
me![text] = "answer B"
Case 4
me![text] = "answer C"
end case

Hope this helps. Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top