Proper naming of subform

  • Thread starter tobesurveyor via AccessMonster.com
  • Start date
T

tobesurveyor via AccessMonster.com

Good afternoon,


Currently I have a form called "frmSFieldScheduleSwitchBoard".
This form has a subform called "subfrmWindowCenter" who's source object is
named: "subfrmSFieldSchedule Calendar"

This "subfrmSFieldSchedule Calendar" has several subforms which one of them
is named "subfrm Day1Crew1" whos source object is "subfrmSFieldSchedule
Day1Crew1 3r".

I have created a module that changes the source object of "subfrm Day1Crew1"
to a new form called
subfrmSFieldSchedule Day1Crew1 2r".

I thought I had the correct vba code to complete this but it keeps returning
an error saying it can not find subfrm_Day1Crew1.

I have included the line of code below.

Forms!frmSFieldScheduleSwitchBoard!subfrmWindowCenter!subfrm_Day1Crew1.
SourceObject = "subfrmSFieldSchedule Day1Crew1 3r"

Any help in this would be greatly appreciated.
Thanks,
CF
 
D

Douglas J. Steele

Forms!frmSFieldScheduleSwitchBoard!subfrmWindowCenter.Form!subfrm_Day1Crew1.Form.SourceObject
= "subfrmSFieldSchedule Day1Crew1 3r"

Of course, you need to ensure that the name of the subform control on
frmSFieldScheduleSwitchBoard is subfrmWindowCenter, and that the name of the
subform control on subfrmWindowCenter is Day1Crew1. Depending on how you
added the forms as subforms, the names of the subform controls may be
different than the names of the forms being used as subforms. (It's the name
of the control you need to use if they are different.)

You may want to check http://www.mvps.org/access/forms/frm0031.htm at "The
Access Web"
 

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