Form Data from Multiple Tables (1 Viewer)

HowieZ

Registered User.
Local time
Today, 14:02
Joined
Jan 28, 2000
Messages
10
I am designing a form that prompts the user for an account number, then sets up a filter condition to bring only that one record to the form for editing. Some fields on the main table link to other tables, using combo boxes. The SQL source for the form includes linking the main table with the sub-tables as set up in my relationships. The problem is that the fields in the main table that link to the sub-tables are not always required fields. So, when I pull a record that doesn't SQL link to the sub-tables, I get nothing because the filter condition is not satisfied. I'm wondering if there is a better way to provide flexibility while pulling or linking from the sub-tables only when those linked fields contain data. Thanks.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:02
Joined
Feb 19, 2002
Messages
42,983
Use a Left Join in the query rather than an inner join. A left join says - return all the rows of tableA and any rows of tableB that match on the link fields. An inner join says return only the rows of tableA that match a row in tableB on the link fields.
 

Users who are viewing this thread

Top Bottom