Results 1 to 8 of 8

Thread: option box

  1. #1
    Join Date
    Jul 2003
    Posts
    41

    Wink Unanswered: option box

    How do You set the commands on an option box?
    Patricia Robey

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    your question probably needs refinement.

    an option box doesn't have "commands" but it does have events (e.g. itsName_afterupdate) into which you can place code.

    if it's a group of options, the group as a whole has events: typically you set up the group to have values 1, 2, 3 when the user selects this, that, theOther so in the groupName_afterupdate you can
    select case groupName.value
    case 1
    'do this
    case 2
    'do that
    case 3
    'do the other
    end select

    izy

  3. #3
    Join Date
    Jul 2003
    Posts
    41
    Originally posted by izyrider
    your question probably needs refinement.

    an option box doesn't have "commands" but it does have events (e.g. itsName_afterupdate) into which you can place code.

    if it's a group of options, the group as a whole has events: typically you set up the group to have values 1, 2, 3 when the user selects this, that, theOther so in the groupName_afterupdate you can
    select case groupName.value
    case 1
    'do this
    case 2
    'do that
    case 3
    'do the other
    end select

    izy
    Patricia Robey

  4. #4
    Join Date
    Jul 2003
    Posts
    41
    Originally posted by robeyp
    SO how do I set this up for an event to be behind the numbers in my option box.
    Patricia Robey

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you've made an option group called myGroup that contains three radio buttons... you told the wizard you wanted labels "do this", "do that", "do other" and later that the values are respectively 1, 2, 3

    in the form code module, top left combo: select myGroup. top right combo: select AfterUpdate

    access provides some prototype text:
    Code:
    Private Sub myGroup_AfterUpdate()
    
    End Sub
    you type in the middle so you get to
    Code:
    Private Sub myGroup_AfterUpdate()
    select case myGroup.value  'ooops, this originally read groupName. which is WRONG
    case 1
    msgbox "my user selected option 1: do this"
    case 2
    msgbox "my user selected option 2: do that"
    case 3
    msgbox "my user selected option 3: do other"
    end select
    End Sub
    msgboxes are not exciting so you need to put some real code there instead so that something useful happens.

    izy
    Last edited by izyrider; 08-11-03 at 14:45.

  6. #6
    Join Date
    Jul 2003
    Posts
    41

    Unhappy

    Totally confused!!!!! I am a beginner in Access.
    Patricia Robey

  7. #7
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ho hum!

    what EXACTLY are you trying to achieve? what do you want to happen when a user selects an option from your option group?

    if you can describe it, someone will code you up a demo.

    izy

  8. #8
    Join Date
    Jul 2003
    Posts
    41
    When someone selects an option, the option should open a form for them to enter data.

    Thanks for your help.
    Patricia Robey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •