Consulting

Results 1 to 12 of 12

Thread: userform toolbox

  1. #1
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location

    userform toolbox

    how can i put a value in a textbox specifically a date that uses a calendar as a tool.
    also i wanted to place a option button that if selected will disable a certain toolbox in a userform

    pls help..

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Add the calendar control to the form, and just get Value porperty and load the texbox with that.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location
    thanks a lot xld

    how about i have a several option button in a userform that when selected will simultaneously disable a certain textbox in a userform

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Yeah, you can do that

    [vba]
    Private Sub CommandButton1_Click()
    With Me.Textbox1
    .Enabled = .Enabled
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location
    i've done the textbox disabling process but i still have problem with the calendar in the userform.

    what i wnted to do is a combobox loaded with calendar...
    im going to select a date and then this will be the value in the box..
    can u pls help...
    with certain detail pls.im just new with vba.

  6. #6

    Calendar Control

    Well, first of all I provide you the codes to enable/disable the text box on the selection of a check box
    1. Place a textbox and a check box on the user form
    Private Sub CheckBox1_Click()
        TextBox1.Enabled = CheckBox1.Value
    End Sub

    2. Now for adding calendar control to your user form, select Microsoft Calendar Control11.0 from the components dialog box.
    3. Add the calendar control to the user form and add following codes to the code window
    Private Sub Calendar1_Click()
        TextBox1.Text = Calendar1.Value
    End Sub
    Chris
    ------



  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by mortred
    i've done the textbox disabling process but i still have problem with the calendar in the userform.

    what i wnted to do is a combobox loaded with calendar...
    im going to select a date and then this will be the value in the box..
    can u pls help...
    with certain detail pls.im just new with vba.
    What do you mean by ... a combobox loaded with a calendar?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location
    Quote Originally Posted by xld
    What do you mean by ... a combobox loaded with a calendar?

    its like a dropdownlist that will pop up a calendar when selected
    i assumed it is a combo box becoz thats how i imagine it looks like.....
    is it possible?

  9. #9
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Popup for what purpose, what do you want to do with it?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  10. #10
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location
    just for selecting a date for the specific textbox so that it will not consume space in the userform

  11. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Now you are confusing me. You started by saying combobox, now you are saying Textbox. What are you trying to do, just save the selected calendar date on the form somewhere?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  12. #12
    VBAX Regular
    Joined
    Mar 2009
    Posts
    17
    Location
    Quote Originally Posted by xld
    Now you are confusing me. You started by saying combobox, now you are saying Textbox. What are you trying to do, just save the selected calendar date on the form somewhere?


    I will use the userform for data entry and i have several textboxes...
    while encoding on the boxes that does not require a date entry i dont want the calendar to appear in the form, when im about to encode a required date the calendar will appear.

Posting Permissions

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