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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,214,548
Messages
6,120,146
Members
448,948
Latest member
spamiki

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