Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Keep Option Group Value

Keep Option Group Value


I'm using an option group to set the value of a text field on a form.

    Select Case Me.ogHomeType
    Case 1
    Me.HomeType = "IL"
    Case 2
    Me.HomeType = "F1"
    Case 3
    Me.HomeType = "SH"
    Case 4
    Me.HomeType = "RH"
    End Select

When reopening the form all the option radio buttons are blank, which is confusing for users. If HomeType has value SH for example, I'd like radio button 3 to show up as selected.

RE: Keep Option Group Value

I would store the number rather than the text in the field so that you could bind the option group to the field. Your kludge workaround is to set the value of ogHome in the On Current event of the form. The code would be the opposite of your Select Case statement


   Select Case M.HomeType
    Case "IL"
        Me.ogHome = 1
    Case "F1"
        Me.ogHome = 2
    Case "SH"
        Me.ogHome = 3
    Case "RH"
        Me.ogHome = 4
   End Select

Hook'D on Access
MS Access MVP

RE: Keep Option Group Value

Looks like PH and I posted about the same time and he didn't miss the "e" in "Me.HomeType"

Hook'D on Access
MS Access MVP

RE: Keep Option Group Value

Great, thanks chaps, that works just fine. Much appreciated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close