Solved

MS Access Forms with Multiple Record Sources

Posted on 2008-10-31
5
933 Views
Last Modified: 2013-11-28
Is it possible to include data from multiple record sources in one of my MS Access forms? What I have is a form that I use to assign id codes to client invoices, and I have two queries. One looks like "select * from work_done where invoice_num is null and client_id=[Client ID]" and the other is "select [complicated string manipulation expression] from work_done where client_id=[Client ID] and invoice_num is not null" (it generates the invoice's id code from the date, the client's name, how many previous invoices I sent out this month, etc.). Both share the same [Client ID] parameter and it's the only parameter for both queries.

The problem is that in the Form properties, there only seems to be room for one record source. My question is how do I get two different record sources into my form? (I can't combine them into a single query, I don't think, because one query returns only the rows with null invoice_num and the other needs the non-null invoice_num .)
0
Comment
Question by:tjgquicken
  • 3
5 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 22850785
If you are selecting different fields - as you appear to be doing- then you should see if you can use a use a main form /subform structure.

If you were selecting the same fields then probably you would use a union query to bring the two results into a single list.
0
 
LVL 10

Expert Comment

by:LennyGray
ID: 22851045
This comment is not for points.....................

If you expect to add or change data in any or all of the individual tables, then you should have a subform for each dataset. The Master/Child properties of each subform will synchronize the data in each subform based upon the main table (where the Client information is displayed).

If you are simply displaying data, then peter57's solution for the union query is the most efficient.

Good Luck!!
Lenny Gray
0
 

Author Comment

by:tjgquicken
ID: 22851622
I think my problem here is that one of my queries returns a collection of rows, while the other one returns a single value. The union query doesn't seem to like that.
0
 
LVL 10

Expert Comment

by:LennyGray
ID: 22851809
the union query requires that the structures of ALL tables/queries being merged are exactly the same.
0
 
LVL 10

Accepted Solution

by:
LennyGray earned 250 total points
ID: 22851814
Use multiple subforms, then
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question