Referencing controls on a 2010 Navigation Form

I have an old .mdb that I am attempting to upgrade.  I have imported all of what I feel are the necessary tables, queries, forms, reports, and modules into a new .accdb database.  I have also incorporated several of the forms into a Navigational Form (frmNavigation; verticle tabs left style).  One of the forms ([Report Dates Entry Form] has vba code attached to a command button that needs to set the value of a date variable to the value of another control ([EndDate]) on the form.  In the old line of code this was accomplished by :

dteWeekEnd = Forms![Report Dates Entry Form]![EndDate].Value

After doing some reading I thought the that once the form was placed in the Navigation Form (attached to NavigationButton9) that the proper syntax would be:

dteWeekEnd = Forms![frmNavigation]![NavigationButton9].[Form]![EndDate].Value

But now I get an error stating "Object doesn't support this property or method
What am I doing wrong?
cekendricksAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
open the form in design view,  and click on the outer edge of the subform and open the property sheet
click on the ALL tab

see the image
subformControlname.jpg
0
 
Rey Obrero (Capricorn1)Commented:
try

dteWeekEnd = Forms![frmNavigation]![Report Dates Entry Form].[Form]![EndDate].Value
0
 
Rey Obrero (Capricorn1)Commented:

dteWeekEnd = Forms![frmNavigation]![Report Dates Entry Form].[Form]![EndDate].Value
-------------------------------------------------^^^^^^^^^^^^^^^^  use the subform control name
0
 
cekendricksAuthor Commented:
When I tried the first suggestion I get an error stating that "Access can't find the field 'Report Dates Entry Form'"

I don't understand the second statement....do you mean the control on the Navigation Form?  NavigationButton9 ?

I've already tried:
dteWeekEnd = Forms![frmNavigation]![NavigationButton9].[Form]![EndDate].Value

which didn't work either...I don't really think I understand which control you're referring to by 'Subform control name'
0
 
cekendricksAuthor Commented:
Top Notch, and extremely timely assistance !
0
All Courses

From novice to tech pro — start learning today.