Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

Query search criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pompeyjim - 17 Apr 2005 15:36 GMT
I am trying to get a printout of an invoice and I’m having a lot of trouble
getting it to print the information I want. The information for each invoice
is on an order form which contains Name, Address, Order no etc. This form
contains a Subform with each product on it.
The subform gets it data from a query with the criteria set to Date(), so
that it only gets the order products from the current days date. This also
applies to the query I use for the data in the main form.
However, the subform query shows every record of every order from the
current day, so that in the printout, Order No 12, for example, prints all
the products that are in the query including those of Order No 13 ,14 etc as
does Order No 13, Order No 14 and so on.
How can I get the query for the subform to show only the products for the
current order number without having to physically type in the correct number
in the query criteria box?  
Allen Browne - 17 Apr 2005 17:15 GMT
Presumably you have two tables:
- an Invoice table that feeds your main form, with an InvoiceId primary key;
- an InvoiceDetail table that feeds your subform.
The InvoiceDetail table will have an InvoiceId field also, which tells which
invoice this row belongs to. If that is a new idea, open the Northwind
sample database, and see how the Order and OrderDetail tables work.

Once you have the form and subform working correctly, you can use the
InvoiceId in the main form to print out the invoice laid out as desired as a
report. Details in article:
   Print the record in the form
at:
   http://allenbrowne.com/casu-15.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I am trying to get a printout of an invoice and I'm having a lot of trouble
> getting it to print the information I want. The information for each
[quoted text clipped - 13 lines]
> number
> in the query criteria box?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.