How to create a Price List (1 Viewer)

wind54surfer

Registered User.
Local time
Today, 10:35
Joined
Jan 19, 2005
Messages
31
Hi all,

Before I start, please know that I am what you call a newbie to a certain extent even though I created in the last 3 years a very complex and efficient database for my business.

This is going to be hard to explain, but I'll try.

The time came to stop creating the Price List in Excel and copy and paste in Access.(mainly to make it easy for other person to maintain and understand)

I know more or less the tables that will need to be created.

My problem is how to store calculated fields in a table (I know I really shouldn't, but how else can I accomplish this), since all the costs and selling prices are the result of complex formulas.

If this information is not enough to understand my question please let me know.

Thank you for any help.
Emilio
 
R

Rich

Guest
Base your price lists on Queries which have calculated fields in them
 

neileg

AWF VIP
Local time
Today, 15:35
Joined
Dec 4, 2002
Messages
5,975
I suspect you are basing your forms on tables rather than queries. As Rich suggests, just about any formula that can be set up in Excel can also be set up in Access.

In case this is too much of a redesign, as an interim measure, you could keep your Excel sheet and link this as a linked table to save you needing to copy and paste.
 

wind54surfer

Registered User.
Local time
Today, 10:35
Joined
Jan 19, 2005
Messages
31
Thanks for your responses,

Like I said at the beginning I am a Newbie, in the sense that on top of running my business once every two months or so I get to make some additions or changes (which I love to do), being self-tought I forget easily and need some remainder to get started.

You mentioned using queries, do you mean populate the table tblProducts (Price List) with queries or using queries instead of tables?

I MUST use tables because that is what the salesreps use in our Palm devices to sell the jobs (all our prices are in computer).
Also when they enter the orders in the PC they populate the tblOrderDetails from the tblProducts.

I will send you my table tblProducts to get an idea of what I mean, English is my 3rd language and I have problems expressing my thoughts.

I hope is clear enough, I please need a little bit of guidance and I can go from there.

Thank again,
Emilio
 

Attachments

  • PriceList.zip
    73.5 KB · Views: 2,407

neileg

AWF VIP
Local time
Today, 15:35
Joined
Dec 4, 2002
Messages
5,975
Your written English is better than most of the people I work with, and I'm in England!

A query is preferred to a table as the data source for a form for a number of reasons. These include the ability to sort the data, to select some rather than all of it and to apply calculations. You can export a query as data in a format that will be useable on the Palm devices. A calculated field within an Access query will then be a firm value when the data is exported. Next time you run the query to export it, the values will change if the underlying data has changed to reflect pricing differences.

When you view data in Access in a table, you aren't really seeing the data, you're seeing a view of it that is pretty much the same as a query.

Oh, I couldn't read your attachment. I only have Access 2000.
 
Last edited:

wind54surfer

Registered User.
Local time
Today, 10:35
Joined
Jan 19, 2005
Messages
31
Thanks again Neil,

I converted the mdb to 2000 if you want to see it.

I understand what you saying, but have problem visualizing how to accomplish it.

What I want to do is create a form where a user can enter new products and update prices when needed.

I created a frmAddProducts some of the tables are not yet designed.

I wrote what I want to see happen in the form, the problem is how to make it happen.

Thanks for your patience.

Emilio
 

Attachments

  • PriceList2000.zip
    75.4 KB · Views: 1,577

neileg

AWF VIP
Local time
Today, 15:35
Joined
Dec 4, 2002
Messages
5,975
OK, now examined.

You ask how to implement Perform=((((ListPrice*Discount)*PST)*Rebate1)*Rebate2)*Markup1*Salesrep*Salesrep2*GST

Just like that, really. Assuming you have a table that holds fields with the names included on the right of the equals sign, you would create a query based on the table. (If you hold things like GST in a different table you'll have to add this to the query).

Create a calculated field like this
Perform: ((((ListPrice*Discount)*PST)*Rebate1)*Rebate2)*Markup1*Salesrep*Salesrep2*GST
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:35
Joined
Feb 28, 2001
Messages
27,171
Emilio

Neileg is giving you specific advice. I'm going to give you some more general advice.

The reason we suggest never storing a computed value in a table has to do with saving space vs. saving time. USUALLY, the computer is so fast that any minor in-line computations are pretty much invisible. There is also an issue called normalization that applies here. If the price is immutable in any place except your master pricing list, then computing the price is wrong. You want to look it up. If that means a lookup qualified by dates, so be it. But something you said makes me want to consider your problem from another viewpoint.

You suggested that it would be possible to alter prices a bit more casually than some people do. If that is your business rule, then it is absolutely right (in fact, NECESSARY) to take that fact into account. But it also means that a lookup and recompute is not so easy any more.

Here are some cases demonstrating the principle to consider. You have to decide which (if any) apply to you.

1. Prices stored in the price table are rock-solid but change over time as you economize, amortize, or whatever. In that case, you store starting and ending dates in the price table, which therefore includes item number, two dates, and a price. Then, when you deal with prices for any transaction, you have the transaction date and identification of each item sold. You can identify the price by basing your lookup on the item number and the dates during which that price was applicable.

2. Your sales reps have local price override capability because the price is only a guideline at best. In that case, you MUST store the price that they used for any give line item because you have no later way to capture it otherwise, and a recompute for later review or other accounting activity is flat impossible.

3. Your sales reps have some discretion in the discount rate to apply to an otherwise solid price, but both the price and the list of possible discount rates are rock-solid other than changing on some regular schedule. In that case, you must store the chosen discount code (or codes) that were applied. The discount and price tables must then be time-tagged for dates during which those prices and discounts were applicable. You could compute the sales price for each item from the combo of the item number, base price, discount codes, and dates.

In all three cases, what you are shooting for is that you must store everything for which a CHOICE was available. Because in the implied model underlying your record-keeping, it is that CHOICE that depends on the date and invoice information. If the choice included raw unit price, you must store the price. If the choice included discount codes, you must store the discount codes. If the choice included the item number (which it probably does), you store THAT.

Now, as to queries:

A table and a query are ALMOST the same thing. Except that there is no way to store a formula in a table. You can store the result of a formula in a table, but not the raw formula itself. On the other hand, a query CAN hold a raw formula. It is possible to build forms, reports, and VBA code to manipulate recordsets based on queries. If you use SQL aggregate functions in a query, it is possible that you could build a query that cannot be used to update individual records, but other than that, anything a table can do, a query can do.

Now, the reason we say that you should not store the RESULT of a formula in a table depends on whether the formula does or does not involve an item for which a choice existed (as explained in the discussion above.) If there was no choice involved, there is no need to store anything. But where a choice occurred, the choice is implicitly PART of the information defined by the invoice number. And THERE is where the normalization rule creeps in. You don't store anything in a table that didn't depend on the prime key of that table. If the price wasn't a choice, it doesn't belong in the invoice table. If the discount code wasn't a choice, it doesn't belong in the invoice table. The items sold were a choice, so they have to be associated with the invoice number. The date was a choice (the customer CHOSE to make the purchase on that date) so you have to store that with the invoice.

I hope that helps clear up some of the confusion.

Having said that, there ARE some computations that CAN be stored in a table FOR CONVENIENCE. Like, the total sale price of an invoice can be stored with the invoice even if it could be recomputed by querying the line items associated with the invoice. Because that won't change over time. I.e. the total sale price won't change if you change component prices after the fact. BUT this is generally a wasteful practise and can lead you down to a wilderness of confusion very quickly. Which is why some folks don't even store invoice prices with the invoice. Me, I would store it as a sanity check just to be sure that my line-item query is properly built so that when I compute the invoice total for my report, it has to match what I stored when I first entered the invoice. Otherwise my logic is wrong. The mere fact that it makes certain reports easier to write is, as we say in south Louisiana, just a little lagniappe (Cajun Fr. = added benefit).
 

wind54surfer

Registered User.
Local time
Today, 10:35
Joined
Jan 19, 2005
Messages
31
Thank a lot for taking time to help me DocMan.

I think I understand exactly where you are coming from.

I understand that is VERY important to keep the orders (Invoices) historically correct.

Early on I made sure that my Order Details reflect the prices at the time of sale, having taken care of this, correct me if I am wrong but I don't see that is there any harm in changing the prices in the Price List or keeping them in a table?

If I could start my database all over again, there are many things I would change, unfortunately I can't spend the necessary time to do it compounded with "if it ain't broken don't fix it" and foremost my total lack of knowledge, so you can guess where I am going.

I want to keep things the way they are with one exceptions, I want to populate my Price List (table Products) with the calculated values, my educated guess will be to enter the info from tables (to be created)into forms.

I understand that it will involve entering formulas in queries in that form (s), how to make the result of those formulas show up in the table is the million dollar question for me :( .

Any help is greatly appreciated,
Emilio
 

neileg

AWF VIP
Local time
Today, 15:35
Joined
Dec 4, 2002
Messages
5,975
If you want to update your prices in the price table, you could use an UPDATE query. Alternatively, it is possible to use a form to amend your table.

If you want to add new products and prices, you may want to use an APPEND query.

By default, the Access query grid creates a SELECT query but there's a drop down option on the tool bar to change the query type.
 

Users who are viewing this thread

Top Bottom