Field to = Calender Control

P

PR

Access 2003

I am trying to get a field in a sub form equal the date that a user has
selected on a calender control in the main form...

Is it possible?

Regards - PR
 
L

Linq Adams via AccessMonster.com

When you have a calendar on a Single View form and select a date from a
calendar, you can assign that value to a field using code like

Me.DateFieldName = YourCalendar

or

Screen.PreviousControl = YourCalendar

where you click on the date field in your form then click on the calendar.

The problem with using a calendar on the main form to set a field on a
subform is that when you click on the calendar, you have left the subform,
and Access has no way to know which record on the subform is your target
field resides in.

The only way I can see to do this would be to first select your date from the
calendar, then Double-click on the field on the subform that is the target,
which triggers this code:

Private Sub SubFormDateFieldName_DblClick(Cancel As Integer)
SubFormDateFieldName = Parent.YourCalendar
End Sub
 

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