• option group default value (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » option group default value (Access 2000)

    Author
    Topic
    #357793

    How can i change the default value of an option group through a code?

    I have an option group called office with 5 options. I want to change the
    number of the option through a code like that:

    Public function Foffice()
    DoCmd.OpenForm “FOrderInformation”
    Dim office As Control
    Set office = Forms![FOrderinformation]![office]
    office.DefaultValue = 1
    etc etc
    ..
    end function

    However it doesnt work, the option value is not changed.For example, if the
    option value was 5 it remains 5 and does not change into 1.Can i write a code doing
    this, instead of doing it manually?

    Viewing 1 reply thread
    Author
    Replies
    • #532268

      What you wrote should work. What you actually see on the screen of the 2nd form will depend on what is displayed. That is, if you display a current record, changing the default value won’t change the value on the screen. While in 2nd form, go into De###### to verify what DefaultValue is.

    • #532273

      Do you want to change the default value or the value? As Mark said, the code you posted should work to change the default value. If you want to change the actual value, just use the syntax optiongroup=number.

    Viewing 1 reply thread
    Reply To: option group default value (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: