Results 1 to 4 of 4
  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 four option boxes with radio buttons to enter in a series of 4 values. I have also written a script for those numeric values to enter in the appropriate text into the database table:

    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



    The label "optwnvres" is the name of the option group and label "WNV results" is the name of the database field. I have also set the default value of the option group to "Negative."

    I'm having trouble with the display of the option buttons as you can see from the images, each time I select an option the button greys-out. If I select an option from another group, all options on the previous option group grey-out.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So, lets see if I understand.....


    • You have an option control with 4 options: 1 thru 4.




    • When you select an option, you convert the option number from an integer to a string.


    • When you move back to that control or select a different control, all options in the control "optwnvres" is grayed out.


    What would you expect to happen if the option control is expecting an integer value and it gets a text string?

    -----
    In a *copy* of your database, change the field [WNV results] to an integer field and remove the after update code from the option control. Does it show the correct selection?
    -----

    When you need to change the integer value to a string, you can have a table with two fields, "WNV_Number" and "WNV_Desc", and add the table to a query to get the desc.

  3. #3
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10
    Can I have a hidden control that takes the value from the option group (an integer) and enters the approriate text value in the database? Do you instead recommend putting the WNV_number and WNV_desc fields in the actual database table?
    Thanks
    Will
    Last edited by wlumpkin; 02-15-2011 at 03:28 PM.

  4. #4
    wlumpkin is offline Novice
    Windows 98/ME Access 97
    Join Date
    Feb 2011
    Posts
    10
    Is the only way to make this work to have two fields in the database and convert one of those to the appropriate text value?

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

Similar Threads

  1. option group default values
    By wlumpkin in forum Access
    Replies: 6
    Last Post: 02-07-2011, 06:07 PM
  2. Combo Box and Option Group Values
    By Desstro in forum Queries
    Replies: 8
    Last Post: 09-06-2010, 11:40 PM
  3. Option Group - Borders are gone
    By cevatyildiz in forum Forms
    Replies: 0
    Last Post: 04-30-2010, 06:08 AM
  4. Option Group
    By huskies in forum Forms
    Replies: 9
    Last Post: 12-02-2009, 12:06 PM
  5. option group in form
    By mawa4492 in forum Forms
    Replies: 1
    Last Post: 08-05-2009, 02:49 PM

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