ReefIT
asked on
To hide the Calendar Control when it losses focus.
Hi All,
I have an Access 2003 app and I am experimenting with the Calendar Control 11.
When the calendar control (calDOB) losses focus I want to hide it. (i.e calDOB.Visible = false)
If I put Me.calDOB.Visible = False in the 'On Exit' event of the calendar control, you can't remove focus from the control at all.
If I put the same line into the 'On Lost Focus' event of the calendar control, the focus moves onto the next control but the calendar is still visible.
The only way I seem to be able to accomplish this is to put me.calDOB.visible = false into the 'Got Focus' event of all the other controls on the form. This is obviously messy.
Is there a better way?.
Thanks
I have an Access 2003 app and I am experimenting with the Calendar Control 11.
When the calendar control (calDOB) losses focus I want to hide it. (i.e calDOB.Visible = false)
If I put Me.calDOB.Visible = False in the 'On Exit' event of the calendar control, you can't remove focus from the control at all.
If I put the same line into the 'On Lost Focus' event of the calendar control, the focus moves onto the next control but the calendar is still visible.
The only way I seem to be able to accomplish this is to put me.calDOB.visible = false into the 'Got Focus' event of all the other controls on the form. This is obviously messy.
Is there a better way?.
Thanks
hi ReefIT
I assume calDOB is hidden by default and is made visible on an event from another control (eg an Enter into a text box).
A further assumption is that the user will select a date from calDOB which will populate another control - why not just pass focus to that field OnClick from calDOB, and then make calDOB.Visible = False?
I assume calDOB is hidden by default and is made visible on an event from another control (eg an Enter into a text box).
A further assumption is that the user will select a date from calDOB which will populate another control - why not just pass focus to that field OnClick from calDOB, and then make calDOB.Visible = False?
'Is there a better way?.'
No, unless you are prepared to direct the user to a specific control after they have left the calendar.
(In which case you only have to add the 'messy' code to that control.)
No, unless you are prepared to direct the user to a specific control after they have left the calendar.
(In which case you only have to add the 'messy' code to that control.)
Sould be in the on click of the calendar
Date1.Value = Calendar4.Value
Date1.SetFocus
Calendar4.Visible = False
Date1.Value = Calendar4.Value
Date1.SetFocus
Calendar4.Visible = False
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
http://msdn2.microsoft.com/en-us/library/aa139958(office.10).aspx
http://office.microsoft.com/en-us/access/HA010546621033.aspx
http://www.lebans.com/monthcalendar.htm
And of course the ultimate:
http://www.dbi-tech.com/product_page_Calendar_Tools.asp
I bought the Component Toolbox ... AWESOME ... blows away all of M$ components.
mx