Subform based on same table as query used for main form

DavidatSchool

New member
Local time
Today, 11:42
Joined
Aug 11, 2008
Messages
8
Hi
I have a main form based on a parameter query ("qryContactsbyName") on the "tblContacts" table.
The main form view is continuous, so a list of matches from the query are displayed, showing summary information.
I am trying to add a subform which will display full information from the "tblContacts" table for the record (in the main form) which the user is currently positioned on.
Access is resisting my efforts, pointing out I am basing my main- and sub- forms on the same underlying table.
I have tried adding explicit relationships.
I would be grateful for ideas or alternatives.
Thanks
 
Assuming you ran a query to pull data from the tbl to create another form*subform) you should be able to use that subform within the main form without issue. Atleast that is what I do when i do overlays. I setup one main form and create a bunch of subforms based on a bunch of queries and i havent had any issue and some do share the same table. Although i have not tried to reference the same field in the main and subform.
 
The message preventing me from doing this is when I use the "Form Wizard" to try to build the form. I have now been able to manually construct the form.
Thanks
 
Make sure that you don't let both forms be editable or you will wind up with problems. In fact, I would use a list box instead of the subform to display the records and then clicking on it to have the form go to that record for editing (no subform required). I say this because you may find yourself with an error saying that this record is already in use by someone else, even though it is you.
 
Thanks Bob - I've checked and it's actually working fine - I have made the "many" records in the main form non-updateable, and they're pulled from a query on the table in question; the "one" in the subform is directly on the table. Between these two it works ok!
 

Users who are viewing this thread

Back
Top Bottom