Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calander pickers

Status
Not open for further replies.

Muzzy

Programmer
Dec 14, 2001
68
GB
Dear All,

I have 82 fields on a form with 82 calander picker buttons. I can assign a value from the calander to the text box for all of these using the following as an example:

Private Sub cmdTryCalendar5_Click()
txtFeasFinish = adhDoCalendar((Me!txtFeasFinish))
End Sub.

However it doesn't look to good. What I want to do is to have one calander and say whichever field has the focus put the date in there. i.e. pass in the name of the active filed as a parameter you the calander knows which field to populate. Any ideas?

Cheers

Muzzy
 
Hi

Does this mean you will be getting rid on the command button used to call the pop up calendar?

If yes, say you are going to call it by double click on the relevant date, then you would have soemthing like:

Private Procedure txtFeasFinish_OnDoubleClick ...etc
txtFeasFinish = adhDoCalendar((Me!txtFeasFinish))
End Sub

So by repeating similar code in each ondouble click event, you do not need to pass control name.

But, having siad that I do not see my you should not be able to apss the control name to the txtFeasFinish = adhDoCalendar((Me!txtFeasFinish)) Function
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Use:
Screen.PreviousControl

As an example:

Private Sub cmdTryCalendar5_Click()
dim ctr As Control
Set ctr = Screen.PreviousControl
Me(ctr.Name) = adhDoCalendar(ctr.Name)
End Sub.

Select the date.
Click the text box that you want to update.
Click your button.

Play around with PreviousControl and ActiveControl and you'll come up with something fine for your needs.

Good luck,

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top