Passing values to subform (1 Viewer)

tmyers

Well-known member
Local time
Today, 01:18
Joined
Sep 8, 2020
Messages
1,090
I am having an issue with passing values from a form into a subform. I have a combo box that the user populates via a text box and when the value is selected in the combo, it sets the forms "ID" to that item. I then dropped a subform on that form and linked them via that ID. However when testing, the subforms ID never becomes the ID selected via the combo.

Capture.PNG


The bottom right is the subforms ID. Am I missing something per chance? Or maybe the subform will never correctly display that, but entries will still be saved under that ID?
 

Minty

AWF VIP
Local time
Today, 05:18
Joined
Jul 26, 2013
Messages
10,355
If you set the master/child references correctly then it will populate as soon as you start to enter a new record.
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:18
Joined
Jan 23, 2006
Messages
15,364
Please describe in simple terms WHAT you are trying to accomplish - perhaps with some sample data. Showing us HOW you have done something that isn't working does not provide enough info to respond with any focus (for me anyway).

Update: Just saw minty's response and agree 100%.
 

tmyers

Well-known member
Local time
Today, 01:18
Joined
Sep 8, 2020
Messages
1,090
Please describe in simple terms WHAT you are trying to accomplish - perhaps with some sample data. Showing us HOW you have done something that isn't working does not provide enough info to respond with any focus (for me anyway).
Fair enough.
I am trying to select a building via the combo box which sets the forms ID to that building for data entry. I then need to pass that ID to the subform via the master/child links to start using cascading combo boxes to populate the building with its electrical equipment.

Once that is done, when you select a different building via the combo on the main form, that subform "clears" as it moves to the next building. I haven't quite managed to get it work that way just yet.
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:18
Joined
Jan 23, 2006
Messages
15,364
Do you have tables similar to

Building-->BuildingHasEquip<--Equip
 

tmyers

Well-known member
Local time
Today, 01:18
Joined
Sep 8, 2020
Messages
1,090
Yes. Building --> BuildingMeter --> Meters
 

Minty

AWF VIP
Local time
Today, 05:18
Joined
Jul 26, 2013
Messages
10,355
In addition to what @jdraw is asking, the BuildingID I think should be a FK_ID not the subforms main ID if I have understood your requirements correctly.
 

tmyers

Well-known member
Local time
Today, 01:18
Joined
Sep 8, 2020
Messages
1,090
Here is a sample for you to look at. The form is ProjectQuote. That is where everything is currently located. I was still messing with combo, so it doesnt really work just yet.
 

Attachments

  • Example.zip
    183.7 KB · Views: 392

jdraw

Super Moderator
Staff member
Local time
Today, 01:18
Joined
Jan 23, 2006
Messages
15,364
You must realize that readers do not know your business in detail. While the terminology and tables make sense to you, they mean little to the "general readership" without some context.
Have you tested and vetted your data model with some sample scenarios and test data?
You may want to play "stump the model".
Good luck with your project.
 

tmyers

Well-known member
Local time
Today, 01:18
Joined
Sep 8, 2020
Messages
1,090
Once again, fair enough. I apologize. I am a little scatter brained this morning.
 

Users who are viewing this thread

Top Bottom