Results 1 to 7 of 7
  1. #1
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10

    option group default values

    I have set up an option group to display a text value on the database table; however, I still need to click onto the default value for it to be entered. Can I set the option group to automatically select the default value?


    Will

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you might try, on a new record, or even the form's load event (or the current event too) to write a line of code in:
    Code:
    me.optiongroup.defaultvalue = -1
    or whatever it is.

  3. #3
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10
    So here's what I have so far. I have four sets of these with different option names. I'd like the default value to be under case 1 for all of them when a new record form is opened up.

    One more issue. The option group won't enter the text value for "Negative" in the table unless I first select another option and then select the first option again.


    Private Sub optwnvres_AfterUpdate()
    Select Case Me.optwnvres.Value
    Case 1
    Me.[WNV results].Value = "Negative"
    Case 2
    Me.[WNV results].Value = "Positive"
    Case 3
    Me.[WNV results].Value = "Suspect"
    Case 4
    Me.[WNV results].Value = "No Test"
    End Select
    End Sub

    Thanks
    Will

  4. #4
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10
    One more issue. The option group won't enter the text value for "Negative" in the table unless I first select another option and then select the first option again.

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by wlumpkin View Post
    One more issue. The option group won't enter the text value for "Negative" in the table unless I first select another option and then select the first option again.
    that doesn't make any sense. I don't know what to tell you.

    got any more info you can give on that?

  6. #6
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10
    Does the code make sense at least?
    Also, each time you select an option it greys out instead of displaying a clean black dot. If you select another option group all displayed buttons on the previous group then grey out.

  7. #7
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    option groups have two groups of options:

    1) one value only allowed
    2) multi-select

    this is not the same for different types of option groups though. if you've spec'd #1 in the property sheet, the rest will grey out, I think, but not sure. your code, it looks to me, changes another option group based on what the current group's option is, right?

    remember too, that option controls, and groups too, have values AND descriptions associated with them. they can get confusing. the VALUE, which is normally not displayed on the screen, is what Access should be putting in the data table.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo Box and Option Group Values
    By Desstro in forum Queries
    Replies: 8
    Last Post: 09-06-2010, 11:40 PM
  2. Option Group - Borders are gone
    By cevatyildiz in forum Forms
    Replies: 0
    Last Post: 04-30-2010, 06:08 AM
  3. Option Group
    By huskies in forum Forms
    Replies: 9
    Last Post: 12-02-2009, 12:06 PM
  4. option group in form
    By mawa4492 in forum Forms
    Replies: 1
    Last Post: 08-05-2009, 02:49 PM
  5. Option Group broken out
    By dcecil in forum Reports
    Replies: 3
    Last Post: 04-21-2009, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums