Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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.

MeldrethMan (TechnicalUser) (OP)
3 Feb 12 7:23

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.
Helpful Member!  PHV (MIS)
3 Feb 12 10:11
You may try this in the Current event procedure of the form:


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

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Helpful Member!  dhookom (Programmer)
3 Feb 12 10:14
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

dhookom (Programmer)
3 Feb 12 10:15
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

MeldrethMan (TechnicalUser) (OP)
3 Feb 12 11:05
Great, thanks chaps, that works just fine. Much appreciated.

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!

Back To Forum

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