A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Product Price dependant quantity



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2005, 11:15 AM
skal via AccessMonster.com
external usenet poster
 
Posts: n/a
Default Product Price dependant quantity

Hi,

I am creating a database for quotation purposes.
The functionality of the database is to input part number and quantity and
get the price of the part dependant on the quantity entered.

E.g. 1-4 £12.00
5-9 £10.00
10+ £8


At the moment I have one table with part No,description etc and in a another
table partno and prices dependant on quantity. E.g

PartNo MinPrice maxPrice
P1 1 4
P1 5 9

My problem is how do I create the input table where I can enter the part no
and quantity and get the price.
I would Appreciate any help

thanks
  #2  
Old October 13th, 2005, 11:39 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Presumably you already have a Product table, and now you are building the
ProductPrice table, where one product can have multiple prices. The fields
will be:
ProductID foreign key to Product.ProductID
MinQty number the minimum number to get this price.
PriceEach currency the charge each for this quantity of this
product.
Example data:
ProductID MinQty PriceEach
1 1 $12.00
1 5 $10.00
1 10 $8.00
2 1 $25.00

Then, when someone orders a quantity of this product, you can get the price
with this function:
http://allenbrowne.com/ser-42.html
like this:
ELookup("PriceEach", "ProductPrice", "(ProductID = " & Nz([ProductID],0)
& ") AND [MinQty] = " & Nz([Qty],0) & ")", "MinQty DESC")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"skal via AccessMonster.com" u14847@uwe wrote in message
news:55c5933f3c922@uwe...

I am creating a database for quotation purposes.
The functionality of the database is to input part number and quantity and
get the price of the part dependant on the quantity entered.

E.g. 1-4 #12.00
5-9 #10.00
10+ #8


At the moment I have one table with part No,description etc and in a
another
table partno and prices dependant on quantity. E.g

PartNo MinPrice maxPrice
P1 1 4
P1 5 9

My problem is how do I create the input table where I can enter the part
no
and quantity and get the price.
I would Appreciate any help

thanks



  #3  
Old October 13th, 2005, 01:59 PM
skal via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

Allen Browne wrote:
Presumably you already have a Product table, and now you are building the
ProductPrice table, where one product can have multiple prices. The fields
will be:
ProductID foreign key to Product.ProductID
MinQty number the minimum number to get this price.
PriceEach currency the charge each for this quantity of this
product.
Example data:
ProductID MinQty PriceEach
1 1 $12.00
1 5 $10.00
1 10 $8.00
2 1 $25.00

Then, when someone orders a quantity of this product, you can get the price
with this function:
http://allenbrowne.com/ser-42.html
like this:
ELookup("PriceEach", "ProductPrice", "(ProductID = " & Nz([ProductID],0)
& ") AND [MinQty] = " & Nz([Qty],0) & ")", "MinQty DESC")

I am creating a database for quotation purposes.
The functionality of the database is to input part number and quantity and

[quoted text clipped - 18 lines]

thanks


Hi Allen

Thank you for your message, I have understood the first part of you message
and have created the table with the product prices as you have suggested but
I do not know how to use the elookup. Please could you explain in more detail
where the code should be placed?

Many thanks
  #4  
Old October 13th, 2005, 02:00 PM
skal via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

Hi Allen

Thank you for your message, I have understood the first part of you message
and have created the table with the product prices as you have suggested but
I do not know how to use the elookup. Please could you explain in more detail
where the code should be placed?

Many thanks
  #5  
Old October 13th, 2005, 04:11 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Choose the Modules tab in the Database window.
Click the New button. Access opens a new module.
Paste the code in there.
Save with a name such as Module1.
Close.

You can now use the ELookup() function anywhere in your app. For example,
you might use it in the AfterUpdate event procedure of the combo where the
user chooses the product in the order, as well as the Quantity. You can see
an example of that if you look in the Northwind sample database, the Order
Details subform, and the ProductID combo. (They use DLookup(), but you need
the more powerful ELookup().)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"skal via AccessMonster.com" u14847@uwe wrote in message
news:55c703e481ea2@uwe...
Hi Allen

Thank you for your message, I have understood the first part of you
message
and have created the table with the product prices as you have suggested
but
I do not know how to use the elookup. Please could you explain in more
detail
where the code should be placed?

Many thanks



  #6  
Old October 19th, 2005, 12:43 PM
skal via AccessMonster.com
external usenet poster
 
Posts: n/a
Default Product Price dependant quantity

Hi Allen

Thank you so much for your efforts to help me so far but I am still unable to
fix the problem. Is it possible to e-mail you the database and you could have
a look at it .

Thanks skal


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200510/1
  #7  
Old October 19th, 2005, 01:29 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default Product Price dependant quantity

Thanks for asking first, but we can't really open everyone's databases and
work through the unending list of things that come as a result.

Are you getting an error message? no result? ...?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"skal via AccessMonster.com" u14847@uwe wrote in message
news:5611c931c2ec4@uwe...

Thank you so much for your efforts to help me so far but I am still unable
to
fix the problem. Is it possible to e-mail you the database and you could
have
a look at it .



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If then Statement Evil_jay General Discussion 8 September 30th, 2005 05:14 PM
finding a value in a grid of numbers Augustus General Discussion 7 September 13th, 2005 12:24 AM
Auto populate a price in a separate field Nyla K Using Forms 3 August 1st, 2005 10:07 PM
Office SP1 cannot install [email protected] Setup, Installing & Configuration 8 August 10th, 2004 03:40 PM
Cry For Help! - Filling In Forms Automatically From Tables -elniniol999- Using Forms 4 May 26th, 2004 03:02 PM


All times are GMT +1. The time now is 06:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.