Solved

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

Posted on 2007-11-19
5
418 Views
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 table...so, 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.
0
Comment
Question by:oceansupport
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:JimFive
Comment Utility
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.

--
JimFive
0
 

Author Comment

by:oceansupport
Comment Utility
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.
0
 
LVL 15

Expert Comment

by:JimFive
Comment Utility
I would consider changing the SQL table structure to something like what is described above.
--
JimFive
0
 

Author Comment

by:oceansupport
Comment Utility
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 MAS....it's very picky and violates standard programming conventions...:(
0
 
LVL 15

Accepted Solution

by:
JimFive earned 500 total points
Comment Utility
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.
--
JimFive
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Familiarize people with the process of utilizing SQL Server views 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 Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

743 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

17 Experts available now in Live!

Get 1:1 Help Now