[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.9

How to display data in a 'pivoted' way... and then update it

Asked by johnclarke123 in Microsoft Access Database, MySQL Server

Tags: MS Access, Forms, Queries, SQL

This is a bit of a complex one to explain: I'm looking for advice on form design and query structure. The response may stray into unbound forms and programmatic updates, so it's a bit of fun...

This is currently an Access 2007 development, but I'm in the process of migrating the back end to MySQL (no SQL Server in this shop).

I have a table holding forecast values for contracts by month (see simplified Forecast table in code). You can see it's structured with a new row for each PO & month being forecast. POs / months for which a forecast doesn't exist have no row (not a row with a null value in FCValue).

However my users want a datasheet type of view into this data, with every PO listed down the left, and FCMonth across the top, extending x months into the future, into which they can type or paste forecasts, which will update the base table. You can totally see where they are coming from. But I can't figure out how to provide this without creating a mess:

(1) Displaying all POs,whether forecasted or not, is simple: a LEFT JOIN on the master PO table will take care of that.

(2) The layout they describe is essentially a pivot. I can see how I could (research how to) dynamically create a pivot in a stored procedure, to create a dataset that could then be applied to a datasheet form. But I'm pretty darn certain it won't be updateable. The same would go for an Access pivot, which I understand is effectively a report control.

(3) The only solution I can see is to do the dynamic pivot mentioned above, throw it into a datasheet form, then use an ON UPDATE or ON CHANGE event (or similar) to trigger a stored procedure (or VB sub if still in Access), passing it the PK information and new value in the parameters.

(4) An alternative to (3) could be a batch update, triggered by the user hitting an 'Apply' button.

Anyone out there encountered this type of problem? Any better ideas?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
CREATE TABLE Forecast(
  PONum INT NOT NULL
, FCForMonth INT NOT NULL
, FCValue double
, PRIMARY KEY(PONum, FCForMonth))
 
 
-- Users want the following:
 
PONum  Mth1   Mth2   Mth3   Mth4
1234     
2442
4680
7531
[+][-]10/30/09 01:29 AM, ID: 25700948Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Access Database, MySQL Server
Tags: MS Access, Forms, Queries, SQL
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 2
Solution Grade: A
 
[+][-]10/30/09 07:39 AM, ID: 25703391Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625