Access Field within Master Form from Subform

Fozi

Registered User.
Local time
Today, 10:58
Joined
Feb 28, 2006
Messages
137
Can someone please help me with this. In mu subforms I'd like to reference a control which is in the master form.

I need to cross reference the contents of a control within my subform against a control in the master form so that I may limit what displays within the combo box.

All help greatly appreciated.

Fozi
 
Me.Parent will send you up from the subform to the parent... The rest you probably know.
 
Sorry I'm not sure where I would put the Me.Parent code.

I've taken the liberty of attached a mock up test to explain what I'm looking to do.

In the attachement there is a form with a subform. In the subform I wish to reference the parent control called "maximum participants" so as to cross reference this with the calculated total within the subform.

Thanks again. Really appreicate it.
 

Attachments

Last edited:
In your case you can use something like [FormName]![ControleName] to reference the controle in the parent form.

General comments:
- Spaces
Dont use Spaces or special Characters (_- etc) in your table/column/form/query names

- Naming convention
Use a naming convention, though access will not have any problems if you dont. Not having a naming convention will cause you problems in the future.
ie. prefix all tables with tbl and queries with qry forms frm
 
Thanks again, but where do I enter the code?

Fozi
 
Where ever you want to use it?? i.e. where ever you want to do your check...
 
That what I thought so I created an unbound control in the subform and entered

=Forms![FRM_Stage 1 Details]![No of Participants (ESF)]

but when viewing the record it comes back with '#Name'


Sorry to be a pest. Is there any chance you could amend the mock database I attached and re-post for me to replicate?

Cheers.
 
In your mock database create a new control on the subform "Training Log Subform" give this as the control source: =Forms![FRM_Training Log]![Maximum Particpants]

That works
 

Users who are viewing this thread

Back
Top Bottom