473,461 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code question in form?

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
6 1236
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Christopher Brandsdal | last post by:
Hi! I have a problem running my code on 2000 server and iis5.0. The code runs perfectly on my localhost (xp iis5.1) but when i run it on 2000 server iis5.0 I get this error: ...
2
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
1
by: ColinWard | last post by:
Hi there. I have the following code in the open event of a form. Most of it sets or checks the value of certain variables so that the form opens properly. It also sets the recordsource for the...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
4
by: Dennis Sjogren | last post by:
Greetings! First, I'm not 100% sure where to post this question. I use VB.NET for this project, but it's really a design question (a question on which method to use when solving this problem). ...
10
by: Michael | last post by:
Hi Everyone. I have been designing a form with about 100 or so controls and today I pasted some code from another test project into this one and then all the controls on the form disapeared from...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.