Want to change the value stored in the bold, it's a code to calculate the payroll. - If txttr.Text = "" Then
-
Form2.txttamt.Text = ""
-
MsgBox "enter the tax rate", vbOKOnly, "ERROR"
-
'Form2.txttamt.Text = ""
-
cbostate.SetFocus
-
Else
-
res1 = txttr.Text / 100
-
End If
-
rs.Open "Select * From empdetail Where name = '" & ListView1.SelectedItem & "' ", conn, adOpenStatic, adLockOptimistic
-
a = rs!whours
-
txtoh.Text = Val(txthrs.Text - a)
-
txtotamt.Text = Val(Form2.txtoh * Form2.txtotrt)
-
res = Val(Form2.txthrs.Text * Form2.txtrate.Text)
-
Form2.txttamt.Text = Val(res * res1)
-
Form2.txtgros.Text = Val((txthrs.Text * txtrate.Text) - (txttamt.Text))
-
'str1 = txttr.Text
-
Form2.txtnsal.Text = Val(Form2.txtgros.Text - Form2.txttamt)
-
rs.Close
-
Set rs = Nothing
Solution to this please, thanks in advance.
9 5355
Am i understanding this correctly...
variable = "value"
changes the value stored in the variable.
So what can you just do that?
Am i understanding this correctly...
variable = "value"
changes the value stored in the variable.
So what can you just do that?
It stores a value at the first computation then we are going in for another computation of emp. salary.
In the meanwhile, res1 stores the value of the first computation. I have to change the res1 to zero for next computation.
I think you understood it.
You can assign any other value to the variable you want.
BTW what is a temporary variable ?
Probably the best thing to do would be to set it to zero when you don't want the value. In other words...
If textbox not valid
Set to zero
Else
Do calculation
End If
Any value you place in the variable will replace what's already there, so you don't need to clear it before using it again.
Probably the best thing to do would be to set it to zero when you don't want the value. In other words...
If textbox not valid
Set to zero
Else
Do calculation
End If
Any value you place in the variable will replace what's already there, so you don't need to clear it before using it again.
no actually the value for previous calculation is stored in "res1"
i have done the same code If textbox not valid
Set to zero
Else
Do calculation
End If
but that is not working bcos res1 is not a built in variable but a user created so it cant be assigned to 0
Do check my code In #1
You can assign any other value to the variable you want.
BTW what is a temporary variable ?
i meant that as a variable that store the mid level calculations.
hope u have gone thru my code,if not please go thru and suggEST A soln.
thanks in advance
Hi,
Before IF Condition, Assign zero to res1 : -
res1 = 0
-
If txttr.Text = "" Then
-
Form2.txttamt.Text = ""
-
MsgBox "enter the tax rate", vbOKOnly, "ERROR"
-
'Form2.txttamt.Text = ""
-
cbostate.SetFocus
-
Else
-
res1 = txttr.Text / 100
-
End If
-
By the way, what is "User Created Variable"...?
Regards
Veena
...but that is not working bcos res1 is not a built in variable but a user created so it cant be assigned to 0
That sentence simply does not make any sense. I think we need to have a bit of a discussion about variable scope and so on.
That sentence simply does not make any sense. I think we need to have a bit of a discussion about variable scope and so on.
yeah,let'z start killer!!!!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tornado |
last post by:
Hi all,
I am pretty new to PHP. I was reading PHP manual and trying out the
example from 2nd
chapter (A simple Tutorial). When i try to print the variable as
given in the example it returns...
|
by: Serge Shimanovsky |
last post by:
Hi,
I have a situation where I need to clear the event sinks from an event. But
let's say I don't know which methods (by name, I mean) signed up for that
event.
I do have a control with...
|
by: JKop |
last post by:
When I compile and run the following on my system:
#include <iostream>
static int hello = 78;
int ReturnValue(void)
{
|
by: Thomasb |
last post by:
With a background in MS SQL Server programming I'm used to temporary
tables. Have just started to work with DB2 ver 7 on z/OS and stumbled
into the concept of GLOBAL TEMPORARY TABLE.
I have...
|
by: Jamie Julius |
last post by:
Consider the following struct:
struct TestStruct
{
public int a, b, c;
public TestStruct(int a, int b, int c)
{
this.a = a;
|
by: Alex D. |
last post by:
Hi. I have a TreeView stored in a session variable...is ok...problem is when
I use Nodes.Clear() then my session variable that holds the TreeView is also
emptied! Is this behavior by design or...
|
by: divya |
last post by:
I have a page name edit.asp which should expire immediately .The user
cannot open this page directly he has to provide a password for
entering this page.thus when the user enters edit.asp , it has...
|
by: dave_dp |
last post by:
Hi, I have just started learning C++ language..
I've read much even tried to understand the way standard says but still
can't get the grasp of that concept.
When parameters are passed/returned...
|
by: venkatagmail |
last post by:
I have problem understanding pass by value and pass by reference and
want to how how they are or appear in the memory:
I had to get my basics right again. I create an array and try all
possible...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |