473,468 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Maths in VB?

22 New Member
Any Help appriciated

Hi all below is what I need to work out basics: I want a form to work out Price per ream and show it in a text box as £££ the form will be manually updated with "Price per Box" and "Reams per Box" Only..

Price_Per_Ream = Price_Per_Box divided by Reams_Per_Box


Thanks in anticipation..

Sal
Sep 21 '09 #1
2 1430
kadghar
1,295 Recognized Expert Top Contributor
Just write the math expression as it comes. If the values are introduced as text, using the VAL function would be nice:

Price_Per_Ream.Text = Val(Price_Per_Box.Text) / Val(Reams_Per_Box.Text)

Assuming those are the names of your textboxes
Sep 21 '09 #2
Salochin
22 New Member
@kadghar
Thanks, had to change slightly but it worked, looking at it I guess I wasnt far off just couldnt seem to get my gray matter around it (typical monday):

Below is what I did using your help, no idea why i couldnt figure that out I was assuming it would be more complex :/ I am new at this but enjoying the learning so guess im not the only one ...
Private Sub PricePerReam_Enter()
PricePerReam = (PricePerBox) / (ReamsPerBox)
End Sub

Private Sub PricePerSheet_Enter()
PricePerSheet = (PricePerReam) / (SheetsPerReam)
End Sub
Thanks for your help

Sal
Sep 22 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jack Higgs | last post by:
Has anyone got any ideas how I could go about producing a maths program for Primary School pupils? The coding isn't such a problem (ie random numbers etc), it's acctually figuring out how to...
12
by: David Sobey | last post by:
i'm looking to do some maths, such as parsing equations into polymorphic trees, matrices, etc. I've done it in C, a mess, but now i want to port it to something less low level (read: less messy)....
5
by: Scott Gunn | last post by:
Hello All, In VB.Net 2003 why is this the result to a simple maths calculation? 3.53 - 3.52 = 0.00999999046325684 Its not just this one either try this: 1.001 - 0.001 = 0.999999999999989
20
by: Daisy | last post by:
Something simple, I'm sure. My code: System.Windows.Forms.MessageBox.Show(((Int32)Math.Ceiling(1966 / 100)).ToString()); I'm expecting 20, but getting 19. What am I doing wrong? Thanks --
9
by: uttre | last post by:
hai to all, i did some programming in Lisp (6 months) & next i want to learn C++. i searched all the archives of "comp.lang.c++" & ACCU too & decided "C++ Primer" 3/e as my text book....
3
by: hars2010 | last post by:
hey i got this assignment in maths.i really need help guys.the question is below.The program should: It first clears the screen and then displays the next 3 lines. a1x + b1y + c1y =d1 a2x +...
1
by: jwatson | last post by:
Write a program to find the roots of quadratic equation. User will key the "a","b","c", for the equation ax*x+b*x+c = 0. formula given as x = (-b(+)(-) sqrt(b*b-4ac)/2a. Prog1: Only find the real...
1
by: TwistedSpanner | last post by:
Hello all, For the record I am a complete java novice. I have to write a program to generate/output to screen 10 simple maths question and output a final score . The question is as follows ...
5
by: Ibys | last post by:
Hi, i am just starting to learn javascript, so i am probably doing something very simple wrong. i have read a lot of articles on maths in java, but cant find anything simple enough for my problem. I...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.