Option groups - possible to have duplicate values?

Im not so strong on writing queries. Should I do case statements for that? Wouldnt that require 1 module for each question? or should I be using else if statements?
 
Last edited:
hahah its nice to hear a compliment sometimes when I usually feel like a leech here :) At least you know I am trying to learn as opposed to looking for someone to write the code for me.
 
Yes you are correct you end up with lots of If then else if type statements , but I don't see any way to get your input back if Uncle Gizmo's reverse engineering wont work.

BTW Before zipping and posting a DB Compact it, yours dropped from almost 4,000kB to under 300kB when I compacted it.

Brian
 
Last edited:
Well the reason I thonk his reverse engineering wont week is that from what I understand is that he is telling me to populte the option groups based on what I have in the table. However the option groups is how to get the info into the table so I dont see how it would work? or do I have to do both thing?

Cause the data to recode the values in the after update event and then recode back in the form on current event of your form so that it shows in the option group what the user originally chose? .
 
>>>There were two options in the options group that produced the same "score"<<<<

Ah ....
I understand your dilemma,

I suspect you have no option then but to have unique values for each option group and record them, and then do your calculations based on the recorded option group number.

Mind you Brian has a good point, why are you worried about displaying the results in the option group? The fact that your questionnaire allows you to record the same value for two different selections means that the actual selection is not relevant once it's been made.

So your solution would appear to be to have the normally working option group with unique numbers for each option selection, (recorded in the table) then use those options selections in conjunction with the case statement to calculate the value and place it in another field in your table. That's the way to do it if you really need the option group to display the original values.
 
Okay this is what I have done. It seems to work but I just want to make sure I have correctly written the code and that it is as "cllean" as possible so that I can cover all eventualities.

Basically what happens now is that if a person choosen yes to question 1, questions 2,3, or 4 appear which they are required to fill out, otherwise they are invisible and the value 99 is put in their box on the table. Since the recode for question 2 depends on the value of question 2, which in turn depends on Question 1, then I put in the statement Me.Q2ClevelandRC = 0 when Q1 is not equal to 0 (yes) (and therefore question 2-4 are invisible).

I then put an after update event on Question 2 using select case statement to produce a value for Q2ClevelandRC. This will therefore only be active when question 2 is visible, since Q2 cannot be updated unless it is visible.

If however they change their mind and make question 1 = yes. Question 2,3 and 4 are updated and their value is now null. They will then be required to answer those questions then causing the after update event of those questions to produce the recoded value.

Does this make sense?
 

Attachments

Users who are viewing this thread

Back
Top Bottom