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 |
#11
|
|||
|
|||
Specify the date of a WeekDay
"TraciAnn via AccessMonster.com" u50702@uwe wrote in message
news:95f7684ab8aa3@uwe... Clif, I've tried both, and they give me the same result (#Name?): After I posted this I remembered that the name of the subform *control* is not the name of the *subform* (unless you renamed the subform control.) That is to say, in this code (both forms)fsubContactTrainSchedule needs to refer to the subform control on the mainform. Clear as mud? -- Clif =DateAdd("d",1-Weekday([Forms].[frmContact].[fsubContactTrainSchedule]. [TrainScheduleDate],4),[Forms].[frmContact].[fsubContactTrainSchedule]! [TrainScheduleDate]) OR =DateAdd("d",1-Weekday([Me].[Parent].[fsubContactTrainSchedule]. [TrainScheduleDate],4),[Me].[Parent].[fsubContactTrainSchedule]! [TrainScheduleDate]) Location of text control with the expression: Forms.frmContact.fsubCommunication.txtTrainingRemi nderScheduled My understanding tells me this should be able to be accomplished with just a simple expression like the one John provided but maybe I need to go to a more complex code. Any ideas? -- --- TraciAnn Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ccess/200905/1 -- Clif |
#12
|
|||
|
|||
Specify the date of a WeekDay
After I posted this I remembered that the name of the subform *control*
is not the name of the *subform* (unless you renamed the subform control.) That is to say, in this code (both forms)fsubContactTrainSchedule needs to refer to the subform control on the mainform. Clear as mud? Huh? -- --- TraciAnn Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ccess/200905/1 |
#13
|
|||
|
|||
Specify the date of a WeekDay
"TraciAnn via AccessMonster.com" u50702@uwe wrote in message
news:95f88563bc208@uwe... After I posted this I remembered that the name of the subform *control* is not the name of the *subform* (unless you renamed the subform control.) That is to say, in this code (both forms)fsubContactTrainSchedule needs to refer to the subform control on the mainform. Clear as mud? Huh? When you put a subform into a mainform, the mainform has a "subform control" and the subform "lives" inside that subform control. When you open a mainform (frmContact) Access adds that form to the Forms collection, so you can refer to it by Forms!frmContact. However, subforms (fsubContactTrainSchedule ) are *not* added to the forms collection, so Forms!fsubContactTrainSchedule will fail. When you are in a procedure in a form, you refer to controls on the form by using the control's name: Me.txtboxName ... To refer to a control on a subform from the mainform, you have to drill down to the subform: Me.NameofSubFormControl.NameofControlOnSubForm In form design view, you can find the subform control and look at it's properties to discover it's name (as opposed to the form it contains.) Does this help? -- Clif |
|
Thread Tools | |
Display Modes | |
|
|