none
How to set the default option button when call the userform RRS feed

  • Question

  • Hi,

    I have created a userform with three button options(named TextOption,ImageOption and ImgWithTextOption),I would like to set the first button option as the default setting like below when call this userform

    I used the following code to initialize it,but it doesn't work as I expected.Could someone tell me what am I doing wrong here?Thanks a million.

    Private Sub UserForm_Initialize() TextOption.Value = Ture NumOfTextOptions.Text = "" NumOfTextOptions.Enabled = Ture TextOptionLayout.Visible = Ture ImageOption.Value = False RowOfImgOption.Text = "" RowOfImgOption.Enabled = False ColOfImgOptions.Text = "" ColOfImgOptions.Enabled = False ImageOptionLayout.Visible = False

    ImgWithTextOption.Value = False RowOfTextImgOption.Text = "" RowOfTextImgOption.Enabled = False ColOfTextImgOption.Text = "" ColOfTextImgOption.Enabled = False TextImageOptionLayout.Visible = False End Sub

    Sarah




    • Edited by SarahSh Monday, September 16, 2013 7:43 AM
    Monday, September 16, 2013 7:27 AM

Answers

  • Try using True instead of Ture

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by SarahSh Monday, September 16, 2013 8:08 AM
    Monday, September 16, 2013 7:42 AM
  • The easiest way to do that is to set the TabIndex property of the NumOfTextOptions text box to 0. This makes it the first control in the tab order.

    If you prefer to use code, insert the following line below the line that enables NumOfTextOptions:

    NumOfTextOptions.SetFocus


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by SarahSh Monday, September 16, 2013 8:08 AM
    Monday, September 16, 2013 8:04 AM

All replies

  • Try using True instead of Ture

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by SarahSh Monday, September 16, 2013 8:08 AM
    Monday, September 16, 2013 7:42 AM
  • Hi,Hans,

    That's it! Can't believe I spend much time on such a typo,thanks very much.

    However,I still cannot get the cursor displayed as the above picture showing when intialized,any suggestions?

    Sarah


    • Edited by SarahSh Monday, September 16, 2013 7:54 AM add word
    Monday, September 16, 2013 7:53 AM
  • The easiest way to do that is to set the TabIndex property of the NumOfTextOptions text box to 0. This makes it the first control in the tab order.

    If you prefer to use code, insert the following line below the line that enables NumOfTextOptions:

    NumOfTextOptions.SetFocus


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by SarahSh Monday, September 16, 2013 8:08 AM
    Monday, September 16, 2013 8:04 AM