Joe
asked on
Translate option group values to text in a report
I have a report that is built based on a query
The report format is mandated by a higher headquarters and must contain specific data.
My db has a field called Report_Type which has 3 options, 1, 2 , and 3
those types need to be translated on the report to a check box:
Initial (1)
Follow-up (2)
Final (3)
How can I translate or convert a single character text field to the coresponding check box?
The report format is mandated by a higher headquarters and must contain specific data.
My db has a field called Report_Type which has 3 options, 1, 2 , and 3
those types need to be translated on the report to a check box:
Initial (1)
Follow-up (2)
Final (3)
How can I translate or convert a single character text field to the coresponding check box?
Opps ... so, you mean 3 check boxes on the Report ?
Not quite following ..
Not quite following ..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Since Option Groups are generally mutually exclusive ..... ?
mx
mx
You're right mx, I was thinking of 3 separate checkboxes. Using a bound option group would make the most sense.
Well ... that's the confusion ... actually. Maybe OP really has 3 check boxes in a 'group' ... not clear.
mx
mx
Try this: using a form, modify if otherwise.
"My db has a field called Report_Type which has 3 options, 1, 2 , and 3"
Change optControl with Report_Type, and (replace with your text) as required
Option Group: optControl, its label: optControlLabel, caption: opt Control Caption
options:
opt1, option value 1, label: opt1Label, caption: opt 1 caption
opt1, option value 2 label: opt2Label, caption: opt 2 caption
opt1, option value 3, label: opt3Label, caption: opt 3 caption
To try it with your existing option group, you need to change names of option group name, and options names only. The code will display the relevant existing caption and the option value.
"My db has a field called Report_Type which has 3 options, 1, 2 , and 3"
Change optControl with Report_Type, and (replace with your text) as required
Option Group: optControl, its label: optControlLabel, caption: opt Control Caption
options:
opt1, option value 1, label: opt1Label, caption: opt 1 caption
opt1, option value 2 label: opt2Label, caption: opt 2 caption
opt1, option value 3, label: opt3Label, caption: opt 3 caption
Private Sub Command7_Click()
Dim result As String
result = Switch(optControl = optControl.Controls(1).OptionValue, optControl.Controls(2).Caption _
, optControl = optControl.Controls(3).OptionValue, optControl.Controls(4).Caption _
, optControl = optControl.Controls(5).OptionValue, optControl.Controls(6).Caption)
Debug.Print result & "(" & optControl & ")"
End Sub
' one result opt 3 Label(3)
To try it with your existing option group, you need to change names of option group name, and options names only. The code will display the relevant existing caption and the option value.
ASKER
Worked like a charm. Thank You!
RptType: Choose([Report_Type],"Init
mx