Button to open Subform

Fozi

Registered User.
Local time
Today, 06:19
Joined
Feb 28, 2006
Messages
137
I have a form on my system. I know how to include a subform on this and I also know how to use a button to open a form. What I want to know is how do you go about using a button to open a subform.

Previous attempts to do this do not insert the common data to the subform control and and such after data entry the data is un-associated.

All help greatly appreciated.

Thanks
Frank
 
I'm confused a bit. You don't "open" a subform. A subform is a form that exists on the main form but with child records.

Previous attempts to do this do not insert the common data to the subform control and and such after data entry the data is un-associated.
That would be due to the links not being set properly or your subform using the wrong recordsource. Many people make the mistake of putting the same recordsource of their main form on a subform and then linking them and it doesn't work right because that's not how subforms are intended to work. They use DIFFERENT tables than the main form.

Does that help at all? Can you clarify some more of what you are actually doing (real life examples of the data involved, tables, etc.)?
 
You should not need a button to "open" a subform. The subform should be linked to the form via a primary key/foreign key relationship.

What is the parent/child relationship for the form and subform?
 
I'm confused a bit. You don't "open" a subform. A subform is a form that exists on the main form but with child records.


That would be due to the links not being set properly or your subform using the wrong recordsource. Many people make the mistake of putting the same recordsource of their main form on a subform and then linking them and it doesn't work right because that's not how subforms are intended to work. They use DIFFERENT tables than the main form.

Does that help at all? Can you clarify some more of what you are actually doing (real life examples of the data involved, tables, etc.)?

Sorry for the confusion. The parent form contains Project Details. What I want is a subform that captures ongoing corresspondence. I know this is pretty straightforward by inserting the subform within the Parent form and linking by Project reference. However to save space on the form I wondered if I could launch the subform by virtue of a command button. So on the parent for the user clicks the button which opens a form to capture corresspondence, with all entries linked by project ref.

Thanks
Frank
 
So, just a point of reference then...you don't actually want a subform as normally defined. You want a popup form to add data to a child table of a parent.

So, you can do this:

You can open the form with OpenArgs in the open command and use a FIND to find if a record exists. If not, it can go to a new record. I'm not able to work out the details at the moment.
 

Users who are viewing this thread

Back
Top Bottom