PDA

View Full Version : DTPicker select date to display in Text box



Danny69
01-17-2020, 02:50 AM
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.

大灰狼1976
01-17-2020, 08:54 PM
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