mesakon
06-05-2018, 07:30 AM
I have a userform that includes 2 textboxes and 2 command buttons as it depicted in the picture.
22365
I downloaded the custom date picker (userform) from internet, and works perfectly. Problem is when I choose the date from commandbutton1 (calling the module), value appears in textbox1(from) but also in textbox2(to) as well. Additionally, when I use the commandbutton2(to) for date picking, value of textbox(from) is changing rather than textbox2(to). I couldn't figure out how to separate those textboxes with same custom date picker.
I used this code to transfer data from date picker to textbox. I know that 3rd should have been removed to not to duplicate same date in second textbox but I could not find any solution.
Private Sub cmdOkay_Click()
DateOut = SelectedDateIn
Questions.FromDate.Text = SelectedDateIn
Questions.ToDate.Text = SelectedDateIn
Me.Hide
End Sub
When I choose date from date-picker, values are storing in SelectedDateIn variable. Since I use the same variable for
both boxes, result is appearing in both and I could not figure out how to
create another variable to store different date values for same userform date picker.
Here is the link of date picker https://trevoreyre.com/portfolio/excel-datepicker/
22365
I downloaded the custom date picker (userform) from internet, and works perfectly. Problem is when I choose the date from commandbutton1 (calling the module), value appears in textbox1(from) but also in textbox2(to) as well. Additionally, when I use the commandbutton2(to) for date picking, value of textbox(from) is changing rather than textbox2(to). I couldn't figure out how to separate those textboxes with same custom date picker.
I used this code to transfer data from date picker to textbox. I know that 3rd should have been removed to not to duplicate same date in second textbox but I could not find any solution.
Private Sub cmdOkay_Click()
DateOut = SelectedDateIn
Questions.FromDate.Text = SelectedDateIn
Questions.ToDate.Text = SelectedDateIn
Me.Hide
End Sub
When I choose date from date-picker, values are storing in SelectedDateIn variable. Since I use the same variable for
both boxes, result is appearing in both and I could not figure out how to
create another variable to store different date values for same userform date picker.
Here is the link of date picker https://trevoreyre.com/portfolio/excel-datepicker/