none
Invoking dialogues RRS feed

  • Question

  • Hi:

    using vba, how can I invoke the dialogues to allow the user to specify the date/time that a task starts/ends.

    The user I'm working with has no use of the mouse.

    regards

    SEan.

    Friday, October 29, 2010 12:40 AM

Answers

  • Hi:

    using vba, how can I invoke the dialogues to allow the user to specify the date/time that a task starts/ends.

    The user I'm working with has no use of the mouse.

    regards

    SEan.


    How about they just tab to the start and finish fields?

    I don't think there is a built-in date picker which does not use the mouse extensively. However you could pop up a simple user form which uses the up and down keys to change the date values.

    For example this code on a text box increases the value by 1 if you press the up arrow and down by 1 if you press the down arrow.

     

    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    If KeyCode = 38 Then
    TextBox1.Value = CStr((CLng(TextBox1.Value)) + 1)
    End If
    If KeyCode = 40 Then
    TextBox1.Value = CStr((CLng(TextBox1.Value)) - 1)
    End If
    End Sub

    You would just need to put the date in there and use similar logic.

    The macro would need to be set to open on a preset key code.

     

     


    Jack Dahlgren blogs at:
    Project and Retrovention
    and rarely Twitter
    Friday, October 29, 2010 3:52 PM
    Moderator