hiding Calender Form button

M

mikeinohio

Hello, i have a form that have a text box and a called:

txtbirthdate and and a command button called cmdbirthdate that when click
it a form called frmCalender pops up and you can select the date that will
be passed back to the text box, my question is how can i hide this command
button until the text box eith is selected and/or gets the focus and then one
the date is entered the command button disappears again.

also as an alternative how can i make it disappear until the text box is
double clicked.
 
M

mikeinohio

Actually i am using Access 2003i already have a text box named txtMedStart
Date anda command button called cmdMedstartDate, all i want is the cmd button
to disappear once the txt box is undated and for it to show once the text box
is clicked, Thanks Arvin, any suggestions?
 
L

Linq Adams via AccessMonster.com

Actually, the simplest thing to do would be to do away with the command
button to bring up the calendar. Instead, replace the command button by using
the DoubleClick event of the textbox to make the calendar visible.
 
M

mikeinohio

Can you briefly explain how that is done, would be apreciated, i been asking
this question for a month
 
L

Linq Adams via AccessMonster.com

Sure! What I do for this type of thing is place a calendar control on the
form, positioned as you like and set it's Visible Property to NO.

Then, using the DoubleClick property of your text box, have the calendar
"popup" for date selection. You'll need to replace YourCalendarName and
YourTextBoxName with the actual names of your calendar and text box.

Private Sub YourTextBoxName_DblClick(Cancel As Integer)
YourCalendarName.Visible = True
End Sub

Private Sub YourCalendarName_Click()
YourTextBoxName.Value = YourCalendarName.Value
YourTextBoxName.SetFocus 'Take focus off of the calendar
YourCalendarName.Visible = False 'MAkes alendar vanish
End Sub

Now, all your user has to do is DoubleClick on the text box and up pops the
calendar! When the user clicks on the date, the calendar disappears and the
text box is populated with the date.

Linq
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top