By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Code question in form?

P: n/a
I have a form that is calculating a labor cost based on some combo boxes. Now
there are 75 different styles that I am basing it on and I have it working no
problem so that I dont need any help with it. However, there is one style
choice where we drill holes in it, and charge 15 cents per hole. Is there a
code that I can add to an after event that will take the # from a dropdown box
(say I make a box for 28 holes, 32, 33, 38, etc) and multiply that # by .15 and
then add it to the previous arguement?

Here is a better explanation
We make 100's of different styles of watch bezels both with and without holes.
Without holes we charge $5. With holes we charge $5 + 15 cents a hole. Now I
already have the code written to display the $5 for the bezels, as well as all
of the other styles we make. How would I add a code that I can say type or
select 33 from another box on the same form, and it would add (33 * .15) +
$5...but if I put nothing in the box it will still display only the $5?
Thanks in advance
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Since you are asking this question, your tables are still not set up
correctly!

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Rated R1" <ra*****@aol.com> wrote in message
news:20***************************@mb-m14.aol.com...
I have a form that is calculating a labor cost based on some combo boxes. Now there are 75 different styles that I am basing it on and I have it working no problem so that I dont need any help with it. However, there is one style
choice where we drill holes in it, and charge 15 cents per hole. Is there a code that I can add to an after event that will take the # from a dropdown box (say I make a box for 28 holes, 32, 33, 38, etc) and multiply that # by ..15 and then add it to the previous arguement?

Here is a better explanation
We make 100's of different styles of watch bezels both with and without holes. Without holes we charge $5. With holes we charge $5 + 15 cents a hole. Now I already have the code written to display the $5 for the bezels, as well as all of the other styles we make. How would I add a code that I can say type or select 33 from another box on the same form, and it would add (33 * .15) +
$5...but if I put nothing in the box it will still display only the $5?
Thanks in advance

Nov 13 '05 #2

P: n/a
Did you read this? What does my tables being set up correctly have to do with
this yet? I didnt even ATTEMPT to add this part into the code. I didnt
attempt to add this into the tables. I was asking how to do it and if it can
be donebefore I try and go for it. What I dont understand, is why people
respond to a plea for help, without help? Why would one take the time to
respond to a question I asked, without a reslution? I never understood that I
see that in every NG. I know that there are many VERY knowledgeable people in
this group, and I was wondering if one of you could provide help for me in this
matter. Thank you in advance to anyone who CAN in fact HELP me.

Scott
Nov 13 '05 #3

P: n/a
Scott,

The equation you need to work with is Price X Quantity = Extemded Cost. To
get price, you need to enumerate each product so you can assign a price to
the product. Style and Product are not synonomous. A style with 28 holes is
a different product than the same style with 32 holes. You differentiate the
products by price; you sell a style with 28 holes for less than the same
style with 32 holes. Your basic table should look like:
TblProduct
ProductID
StyleID
CountOfHoles
Price

In my example, your records would look like:
1 1 28 $9.20
2 1 32 $9.80

Price is determined in the form where you enter your products into the
database not at each sale.

It is obvious from your question that your tables are not set up this way!

Steve
PC Datasheet
"Rated R1" <ra*****@aol.com> wrote in message
news:20***************************@mb-m18.aol.com...
Did you read this? What does my tables being set up correctly have to do with this yet? I didnt even ATTEMPT to add this part into the code. I didnt
attempt to add this into the tables. I was asking how to do it and if it can be donebefore I try and go for it. What I dont understand, is why people
respond to a plea for help, without help? Why would one take the time to
respond to a question I asked, without a reslution? I never understood that I see that in every NG. I know that there are many VERY knowledgeable people in this group, and I was wondering if one of you could provide help for me in this matter. Thank you in advance to anyone who CAN in fact HELP me.

Scott

Nov 13 '05 #4

P: n/a
Presuming your form has these controls:

cboChargeStyle -- the list of 100's of styles
cboNumberOfHoles - self explanatory
txtTotalPrice
Using the AfterUpdate event of cboChargeStyle

....
If cboChargeStyle = "WithHoles" then
txtTotalPrice = 5 + 0.15 * cboNumberOfHoles
else
txtTotalPrice = 5
endif

While this would work for the example cited and the question asked, a
better solution would be to embody most of the pricing in the table
structure. For example, each style should have a record in a pricing
table, and include a field for whether or not it needs holes to be
drilled.
On 26 Aug 2004 13:40:01 GMT, ra*****@aol.com (Rated R1) wrote:
I have a form that is calculating a labor cost based on some combo boxes. Now
there are 75 different styles that I am basing it on and I have it working no
problem so that I dont need any help with it. However, there is one style
choice where we drill holes in it, and charge 15 cents per hole. Is there a
code that I can add to an after event that will take the # from a dropdown box
(say I make a box for 28 holes, 32, 33, 38, etc) and multiply that # by .15 and
then add it to the previous arguement?

Here is a better explanation
We make 100's of different styles of watch bezels both with and without holes.
Without holes we charge $5. With holes we charge $5 + 15 cents a hole. Now I
already have the code written to display the $5 for the bezels, as well as all
of the other styles we make. How would I add a code that I can say type or
select 33 from another box on the same form, and it would add (33 * .15) +
$5...but if I put nothing in the box it will still display only the $5?
Thanks in advance

**********************
ja**************@telusTELUS.net
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
Nov 13 '05 #5

P: n/a
thank you this is what I was looking for it and it has now been implemented
into my form and works perfectly. Thanks again...now if I could only figure
out how to make the resulting text box show/hide based on there being
information in there (like if there are no holes it wouldnt be there, and would
only show up if there are holes)
Audio and Video Trading Lists: members.aol.com/ratedr1/homepage.html
"Marge, You Know That Trying is the First Step Towards Failure!!"
"Ohhh...they have the Internet on Computers Now??
"Damn You Rockem Sockem Robots..Cant We All Just Get Along?" -Homer
Nov 13 '05 #6

P: n/a
sure, just make a combo with the available options for the number of
holes with the default value set to zero. add code to the underlying
module of the form:

Total = (ComboItemName.Value * 5) + (ComboHoles.Value * .15)

don't know if that's exactly what you're looking for, but you should
be able to do something like that, unless the underlying code for
finding the price from your Item combo is using a lookup or something
else along those lines to determine the base price. if that's the
case:

Total = DLookup("Price", "TableContainingItems", "ItemName = '" &
Me.ComboItemName.Value & "'")
Total = Total + (ComboHoles.Value * .15)

once that's done, you can do anything you want with the Total variable
programmatically.

hth
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.