referencing a control on a subform list in a navigation form

jex57

Board Regular
Joined
Oct 29, 2015
Messages
62
hi All,
I have a navigation for 01 Main

On the navigation form, I have a subform FrmSocialGraph

On the FrmSocialGraph I have a Subform FrmSGUsgage - which has a list box on it. From the list box I need to pass a value to the textbox on FrmSOcialGraph.

My code looks as follows:

Private Sub Systemlist_Click()




Forms![01 main]!frmsocialgraph!SystemLookup = Forms.[01 main].frmsocialgraph.FrmSGSystems.Form.Systemlist.Column(0, Me.Systemlist.ListIndex)
DoCmd.OpenQuery "QrySocialGraph_systems"
End Sub


Prior to putting the form onto the navigation form everything worked.
However since trying to reference it through the navigation form, I get an error

OBJECT DOES NOT SUPPORT THIS PROPERTY OR METHOD.

Does anything know how to fix this?
appreciate the help.

Thank you
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
a form put on to a navigation form becomes a subform. The subform gets a default name of NavigationSubform, so unless you actually changed it, try this syntax for a form on a nav form:
Code:
Forms!NavFormName.Form![B]NavigationSubform[/B].Form.ControlName
But I think you're trying to get to one lever deeper on a subform of the form on the nav form? Maybe
Code:
Forms!NavFormName.Form!NavigationSubform.Form!SubformControlName.Form.ControlName
where NavFormName is the name of your navigation form and subformcontrolname is the name of your control that contains your subform (might be the same name as the form it contains):

Code:
Forms!NavFormName.Form!NavigationSubform.Form!FrmSGSystems.Form.Systemlist.Column(0, Me.Systemlist.ListIndex)
as long as the code is on the same form as the listbox, otherwise you can't use Me.

Forms. should always be Forms! not Forms.[01 main]

Not sure where 01 Main belongs in the hierarchy, so I didn't try figuring out your nav form name. FWIW, starting object name with numbers is not a good idea. Plus, names should not contain spaces, numbers or special characters (save for possibly the underscore _).
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top