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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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