Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: Date issue - VBA

    Could someone please help me.

    I have attached my problem,

    on the click of a button, called "Date Box" i have a userform appear.

    i then have a textbox and a button.

    I would like the text box to be autopopulated with today's date, and the button to open a calandar so that this date can be changed if requested.

    my coding is very poor, so thats why i am asking here.....

    Any help would be appreciated.

    Cheers

    Andy
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: Date issue - VBA

    Try this, using the calendar control

    Originally posted by Chimp8471
    Could someone please help me.

    I have attached my problem,

    on the click of a button, called "Date Box" i have a userform appear.

    i then have a textbox and a button.

    I would like the text box to be autopopulated with today's date, and the button to open a calandar so that this date can be changed if requested.

    my coding is very poor, so thats why i am asking here.....

    Any help would be appreciated.

    Cheers

    Andy
    Attached Files Attached Files
    Rick Knight
    KnightShift Office Solutions and Horse Breaking
    VB, VBA, FileMaker, Access Solutions, Web Solutions

  3. #3
    Join Date
    Mar 2003
    Posts
    225
    Hi Rick

    Many thanks for you help, it works if i use Excel 2003, but if i try to run it on 2002.it doesn't and i get a msg box asking me to debug.

    i am not sure if this is a problem with my computer or not....

    I have attached a screenshot of where it appears to be falling down.

    Thanks again

    Andy
    Attached Thumbnails Attached Thumbnails problem.jpg  

  4. #4
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203
    I forgot something, add this line


    Private Sub Calendar1_Click()

    Dim dt1 as string 'Add this line

    dt1 = Calendar1.Value
    Label2.Caption = dt1
    TextBox1.Text = dt1

    End Sub
    Rick Knight
    KnightShift Office Solutions and Horse Breaking
    VB, VBA, FileMaker, Access Solutions, Web Solutions

  5. #5
    Join Date
    Mar 2003
    Posts
    225
    i have added that but it still comes up with the same code highlighted

Posting Permissions

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