philfloyduk
Board Regular
- Joined
- Jan 6, 2011
- Messages
- 82
Hi.
I have a repair booking UserForm that uses Calendar control 12.0. I've used the code below to format it to dd/mm/yyyy which works if you're selecting a date within the current month, but not if you're selecting a date from another month. For example, with today being 24th Feb, if I select 25/02/2011 it'll format correctly. However, if I select 01/03/2011 (which is likely to happen toward the end of the month) it won't format it.
Thanks in advance for any help offered
Private Sub Calendar1_Click()
appdateTextBox.Value = Calendar1.Value
appdateTextBox.Text = Format(appdateTextBox.Text, "dd/mm/yyyy")
Calendar1.Visible = False
apptimeTextBox.SetFocus
End Sub
I have a repair booking UserForm that uses Calendar control 12.0. I've used the code below to format it to dd/mm/yyyy which works if you're selecting a date within the current month, but not if you're selecting a date from another month. For example, with today being 24th Feb, if I select 25/02/2011 it'll format correctly. However, if I select 01/03/2011 (which is likely to happen toward the end of the month) it won't format it.
Thanks in advance for any help offered
Private Sub Calendar1_Click()
appdateTextBox.Value = Calendar1.Value
appdateTextBox.Text = Format(appdateTextBox.Text, "dd/mm/yyyy")
Calendar1.Visible = False
apptimeTextBox.SetFocus
End Sub