![]() |
| ||
| (calc) Subtraction code with VB6 Hey all, I apologize now for being a Noob. I'm using a Tutorial to learn VB6 (for starters) and everything was going great until just now... The assignment is to create a Weekly Payroll. I have managed to figure out how to make the standard calc ( Hrs worked * Rate ) and display properly, however, that's when my legs get knocked out from under me :D I'm not entirely sure how to subtract the deductions. I tried searching but couldn't find a similar situation. Below is my working code, albeit probably OC'd... over-coded. *scratches head... how do I subtract? I 'thought' it would be: If opta.Value = True Then _ intgsal = (txthrs.Text * 10) _ And intnet = (txthrs.Text * 10 - txtded.Text) <-- txtded.Text being my Deductions txtgsal.Text = intgsal txtnet.Text = intnet ...I was sooooo wrong... more errors than a little bit! :D My 'working' code is below - any help would be appreciated! Also, if there are shortcuts (i.e., functions) that I could use in the future - I would like to know that as well! Thanks again! 'setting up Integers for |
| ||
| Re: (calc) Subtraction code with VB6 Got it!!! Figured out the Code I needed... at least for now... 'coding Confirm to calculate |
| All times are GMT -4. The time now is 3:59 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC