Danielle17
Technical User
I already have a post on here about this form but no one seems to no how to answer it. So I guess I'll ask a smaller question first.
I have 4 text boxes on a form. Each will have a number in them. I also have another text box on the form named Totals. How do I get it so that the numbers in the other 4 text boxes add up and go into the Totals text box? I got a code from someone...:
public sub AddTogether()
dim total as double
total = nz(me.txtLodging) + nz(Me.txtMeals) + nz(Me.txtGas) + nz(Me.txtMisc)
me.unboundTotalTextBox = total
end sub
I have it on the AfterUpdate of each of the text boxes. It does not work. If I enter 45 in each of the text boxes the Totals txt box looks like 45454545. It doesn't add them up it just puts them next to one another. Does someone see something wrong with this code. I'm getting really frustrated....I need some answers. Could someone please help?
I have 4 text boxes on a form. Each will have a number in them. I also have another text box on the form named Totals. How do I get it so that the numbers in the other 4 text boxes add up and go into the Totals text box? I got a code from someone...:
public sub AddTogether()
dim total as double
total = nz(me.txtLodging) + nz(Me.txtMeals) + nz(Me.txtGas) + nz(Me.txtMisc)
me.unboundTotalTextBox = total
end sub
I have it on the AfterUpdate of each of the text boxes. It does not work. If I enter 45 in each of the text boxes the Totals txt box looks like 45454545. It doesn't add them up it just puts them next to one another. Does someone see something wrong with this code. I'm getting really frustrated....I need some answers. Could someone please help?