Consulting

Results 1 to 2 of 2

Thread: DTPicker select date to display in Text box

  1. #1
    VBAX Regular
    Joined
    Aug 2013
    Posts
    16
    Location

    DTPicker select date to display in Text box

    Hi,

    On my Userform i want the date selected to be displayed in TextBox1 & TextBox2.
    First time DTPicker selected the date to be display in TextBox1
    and second time when the DTPicker selected date in TextBox2
    when Done selected date is forwarded to Mymacro script.

    If TextBox1 = "" Or TextBox2 = "" Then Exit Sub
    Mymacro.TextBox6 = Me.TextBox1
    Mymacro.TextBox7 = Me.TextBox2

    Any Helps.
    Attached Images Attached Images

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi Danny!
    No tested.
    Private Sub DTPicker1_CloseUp()
        Dim b&
        b = (TextBox1 = "") + (TextBox2 = "") + 3
        If b > 2 Then Exit Sub
        Me("TextBox" & b) = DTPicker1
    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
  •