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

Option Groups

Status
Not open for further replies.

MitchJP

MIS
Feb 17, 2004
43
US
Hi all,

I have a edit form which inlcudes an option group (say, 1-5 options). Let us assume a user has looked at a particular record and selected option "1" (or the first radio button), then saved the record.

When they choose an option, a value is stored (say, when they chose the 1st radio button, it assigned the value "1" to some field).

Now, when they later view the record, I want the form to display which option they previously chose. This is to mean I want the first radio button to be 'selected' upon form load. So what I have is a CASE statement looking at which value is stored (say, 1-5) to determine which option to show as being selected.

The problem for me is what property or control do I modify on form load to make the radio button look 'selected', or filled in?

Thanks for the help,
MitchJP
 
Couldn't you make your option group bound to the field in your datasource. That way it will always reflect the value that was selected.

HTH,
Eric
 
Well, what happens is this:

user picks an option.
based on which option is picked, a value is assigned to field.

so each option isn't bound to a field, but it determines what is stored there programatically. make sense?


Essentially this is what I need to do:

The form loads.

If value of field 'Type' is 1, make radio button 1 show as being selected.
If value of field 'Type' is 2, make radio button ...
If value of field 'Type' is 3, make radio button ...
If value of field 'Type' is 4, make radio button ...
If value of field 'Type' is 5, make radio button ...

'Type' could be 1-5 for the record.
 
Ok. In the form's on current event place this code:

Select Case me.type
case 1
me.radio1=1
case 2
me.radio2=2
'etc.
End select


Still as I stated above by making your option group bound to the type field the value that you assigned to each option button in the option group will be stored in the type field.

HTH,
Eric

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top