If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Changing the date
My main form and sub form (datasheet) are linked by the
date field and another field. If the date is changed on the main form, I would like the dates on the subform to change automatically. I've tried an If statement on the exit event of the date on the main form with forms!fSubForm!txtDate = forms!frmMainForm!txtDate Problem: when the exit event of the main form date runs, it gives the error message that it cannot find the sub form. Any suggestions? |
#2
|
|||
|
|||
Changing the date
Since the control is on the main form, we should be able to use Me for
Forms!frmMainForm to shorten things a little. Next, when a form is opened as a subform, you can't refer to it directly by its name. You have to refer to a control on the main form. This control is a container for the subform. Example: Me.ctlNameOfSubformControl.Form.txtDate To get the name of the subform control, open the main form in design mode, open the Properties sheet, and click on the subform ONE time. The properties sheet should show the name of the subform control. If you click more than once, you'll be in the subform and the Properties sheet will show the name of the subform, not the control holding it. -- Wayne Morgan Microsoft Access MVP "Allie" wrote in message ... My main form and sub form (datasheet) are linked by the date field and another field. If the date is changed on the main form, I would like the dates on the subform to change automatically. I've tried an If statement on the exit event of the date on the main form with forms!fSubForm!txtDate = forms!frmMainForm!txtDate Problem: when the exit event of the main form date runs, it gives the error message that it cannot find the sub form. Any suggestions? |
Thread Tools | |
Display Modes | |
|
|