Consulting

Results 1 to 6 of 6

Thread: date pick error

  1. #1

    date pick error

    hi

    im using the microsoft date pick drop down box but its causing a few errors.
    every time i select the box it shows a second box in the top left corner?
    also it wont let me have multiple date select combo boxes.
    is there a reason for this or a better option?

    thanks ash

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Without code or an example workbook, I don't see how we can help. ActiveX datetime controls can be problematic.

  3. #3
    hi thanks for your reply.
    my apologies, all ive done so far is added the "microsoft date and time picker control 6.0 (SP4)" but it seems to resize its self and then i cant add a second one to the same page.
    is there a better option you could suggest that means i can select a date from a calendar?
    thanks ash

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    This userform method is more reliable.
    Attached Files Attached Files

  5. #5
    hi that is great thank you very much, is it alot of work to change the date format to dd-mmm-yy
    thanks ash

  6. #6
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    No.

    Normally, one would set the format manually.

    If you want to set it for the user and you are using the Sheet Selection event, I would recommend adding an Intersect() so that it fires for just a set range. You can then just set NumberFormat() once.

    Otherwise, if you really want to force it in the Userform code, you will have to modify it in each day button's Click event. That code could be made more efficient though. In any case, to do that the kludgy way, then here is the first one:
    Private Sub D1_Click()    
      ActiveCell.Value = D2.ControlTipText    
    
      ActiveCell.NumberFormat = "dd-mmm-yy"
    
        Unload Me
    End Sub

Posting Permissions

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