Subform not displaying correct records from main form

Kevin Campbell

New member
Local time
Today, 03:32
Joined
Feb 23, 2005
Messages
5
Hello. The problem I am having is related to two tables. I have a table called Void and a table called Panel. A panel can have multiple voids and a void is assigned to only panel (one-to-many). In the Panel table, I set an autoincrementing number(SprayPanelId) for the pK. In the Void table, I set an autoincrementing number (VoidId) for the pk. I place the SprayPanelId into the Void table as a foreign key (same name in the void table). The problem I have is in my forms. I created a Panel form with a button to open a subform for data entry on the voids related to the panel in a new window. Data can be entered and is properly saved in the Void table. I open the Void table in a datasheet view under the table section and see it is properly there. I can run queries where Void.SprayPanelId = Panel.SprayPanelId and it returns the correct void with the correct Panel. The problem becomes when I open my void subform, it no longer displays that record associated with that panel. however, the record is there in my void table. Any thoughts? Do I need a filter perhaps, run any sql commands? Thanks in advance, Kevin
 
:) Hello Kevin!
Forign key in the VOID table maust be a Numeric,
not Autonumber. Did you link this two tables?
Open your main form in design view, click on
subform, click on Properties icon, find
LINK CHILD FIELDS and LINK MASTER FIELDS,
and fill it up.
(MStef alis Štef)
 
fixed

I ended up fixing it. the void subform also iincluded data from 2 other tables that had to be updated. So the Panel form contained a subform that was updating 3 tables at one time. I had to write some VB code for when I clicked on the add button record that it would sychronize the foreign key into 3 tables (not easy to figure out!). Either way I fixed it and got it to work perfectly now. Thanks!
 

Users who are viewing this thread

Back
Top Bottom