Creating form based on Cross Tab Query that allows user input to additional fields.

Posted on 2007-11-19
Last Modified: 2013-11-28
I want to query my SQL table that contains information on product orders  by Style Color Size and Qty ordered.  Query paramater input by the user would be Job# (123 in the below example)

The Query results would be:

Job 123 Style12345 Brown   Small    100
Job 123 Style12345 Brown   Med      150
Job 123 Style12345 Brown   Large    150
Job 123 Style12345 Brown   Small     100


Now I want to take output the results to a Form that looks like a cross tab, but with additional columns for the user to add more information for the order. ie., Price, Due Date, Treatment Type (These three fields don't exist in the SQL, I'm guesing I need to export the query results to a new table).

                                                   Sm        Md         Lg            Xl     Price  DueDate TreatmentType
Job123 Style12345 Brown       100        150       150         100    _____ ______ _____________

BTW, the Size codes can vary ...sometimes X1 X2 X3 X4 or a combination of about 15 size codes.

As a beginner, of course, I'm pretty lost.  But, I'm thinking this would be a good project.

In the end, multiple job information would be stored by multiple users.  They'd then output the completed information to a PDF or hard copy.

Your advice is greatly appreciated.
Question by:oceansupport
  • 3
  • 2
LVL 15

Expert Comment

ID: 20315818
It looks like you are doing a sort of order entry form.

Doing the input as you describe is difficult and probably won't end up working out as you desire.

You probably want to have (at least) 2 tables, one for the order header that would contain Job#, OrderDate, DueDate, CustomerId, and anything else that is job related. Another table for the order detail that would contain style, color, size, qty, price, treatmenttype.  I assume that it might be possible to order the same product with different treatments that might be different prices.  I also assume that prices might change over time (or in fact, between size categories).  If you use this design you will see that what makes sense is to create a mainform/subform design where the job information is in the main form and the product information is in the subform.

You can then process your results into a report as you like.


Author Comment

ID: 20315908
So, appending the header and detail tables with the query results.  This info is showing up on my form...I'm confusing myself since I'm still thinking in terms of my table structure on the SQL side.
LVL 15

Expert Comment

ID: 20319332
I would consider changing the SQL table structure to something like what is described above.

Author Comment

ID: 20319969
SQL is the back end to our MAS200 ERP...can't change the table structure.  I'm considering a separate database so as not to chance interfering with's very picky and violates standard programming conventions...:(
LVL 15

Accepted Solution

JimFive earned 500 total points
ID: 20320081
Well then, yes.  Create a table to hold the additional information that you need.  Link it into a subform from your results so that the data can be filled in.  Your main form can just be your search criteria (e.g. a Select Job # box) and then the subform can be the updatable detail lines.

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now