Multiple Records in Multiple Subforms under Main Form

darkstar257

Registered User.
Local time
Yesterday, 18:57
Joined
Jan 6, 2011
Messages
77
Multiple Records in Multiple Subforms: One-Too-Many Annoyances!

Single form view only displays one record at a time, even if multiple records in the subform are associated with the main form.

My main form has two subforms, but the subforms only pulls up first record entry each time I go to a different record in the main form.

How would I be able to make it so the subforms can scroll through its own records? Do I need to somehow create a second ID?
 
Last edited:
My main form has two subforms, but the subforms only pulls up first record entry each time I go to a different record in the main form. This happens because the main form record ID numbers link to the subform ID numbers being identical. However, only the first entry will have an identical number to the main record as additional records added in the subforms will have incremented IDs and won't be pulled up.

How would I be able to make it so the subforms can scroll through its own records? Do I need to somehow create a second ID?

It kinda sounds like you dont have a relationship setup between the main form and subform.

You should have a FK linking the main form with the subform. Sorry if I misunderstood you.
 
It kinda sounds like you dont have a relationship setup between the main form and subform.

You should have a FK linking the main form with the subform. Sorry if I misunderstood you.

I set up a One-To-Many relationship with the Primary Key ID of the mainform to the subform's ID (defined as "Number," "Allow Duplicates) but it's not assigning IDs as I make new entries in the subform. Is there another mechanism that assigns duplicate IDs to the subforms?

It works flawlessly if I recreate the Subforms using the Wizard and choose "Use Existing Tables and Queries." With that I can create all the records I want and it will all link properly to the main form. However, this forces the subform into the format of a Table which is useless to me...

Seen screenshot below of both. I want the subform to look like the one on the left, but it doesn't pull up more than one record. The only way is creating a subform Table like the one on the right... which I don't want :mad:

I also tried to create the subform as a Table and then change it with the VB command:

Code:
Private Sub Form_Current()
....
Me.Property.Form!ID.SetFocus
DoCmd.RunCommand acCmdSubformFormView
Me.Property.SourceObject = "Table.BaggingFilm"
Me.Property.LinkChildFields = "BaggingFilm.ID"
Me.Property.LinkMasterFields = "ID"
However, it says that my "SubformFormView command is not available at this time" Is there a way to change the view type of a Table to a Form after I used change the sourceobject and child views to a table's?

booooon.jpg
 
Last edited:

Users who are viewing this thread

Back
Top Bottom