Link to home
Start Free TrialLog in
Avatar of Kiwi-123
Kiwi-123

asked on

VB Calendar help

I need to change the following code "Private Sub Calendar1_Click()"

If the following are all blank ""

txtrecieveddate
txtstarteddate
txtcompleteddate

I would like the calendar to intuitively place a date from the calendar click in the first textbox "txtrecieveddate"

The reason I cannot just use the tab stop is that on my spreadsheet there are other boxes, but I have removed these from this help file to avoid confusion.
help2.xls
Avatar of Norie
Norie

If you mean the date clicked in the calendar:
Private Sub Calendar1_Click()
 
  txtrecieveddate.Text = Format(Calendar1.Value, "dd/mm/yyyy")

End Sub

Open in new window


By the way, what is lastActiveDate in the code meant to be?
Avatar of Kiwi-123

ASKER

There are three textboxes, so if one is on setfocus then the calendar should input the date into that. However if the setfocus is outside any of the three and they all equal "", then the calendar would input into txtrecieveddate

I think the lastactivedate was supposed to lock the textboxes, this way the input had to be via the calendar and not entered manually.
When you click the calendar it will get focus and none of the texboxes will have focus.
This is the problem, I'd like the calendar to input into txtrecieveddate if:-


txtrecieveddate = ""
txtstarteddate = ""
txtcompleteddate = ""
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Again Imnorie!