Calendar control

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
Hi All,

I have a form with a date textbox on it and I want to fill it in using an ActiveX Calendar control. I know that by attaching the make visible code to the OnEnter of the textbox,I can show the Calendar, but how do I update the textbox and make the Calendar control disappear after selecting the date.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try this :

Private Sub Text_Enter()
'You know this part, to show calendar
Me.Calendar.Visible = True
End Sub

Private Sub Calendar_Click()
'Set text value as selected date
Me.Text.Value = Me.Calendar.Value
'Set focus on Textbox, otherwise it will not let you make calendar invisible
Me.Text.SetFocus
'Make calendar invisible
Me.Calendar.Visible = False
End Sub

I hope this helps

Regards
Suat
 
Upvote 0

Forum statistics

Threads
1,221,507
Messages
6,160,219
Members
451,631
Latest member
coffiajoseph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top