updating a text box

lordnikon

New member
Local time
Today, 13:21
Joined
Jun 23, 2008
Messages
8
I have a text boxes that is updated based on a selection from a combo box. It updates several text boxes that contain prices, and some times that value is "$0.00." when i update that text box it doesn't put a value it in. It does if the value is anything but zero. I put the default value to zero and it fills it in with $0.00 when i open the form but when I update that value, it clears it out. Any help on how i can get these text boxes to insert the value $0.00?
 
I have a text boxes that is updated based on a selection from a combo box. It updates several text boxes that contain prices, and some times that value is "$0.00." when i update that text box it doesn't put a value it in...

Exactly how does the combobox update the textbox?

What is the datatype of the field that's bound to the textbox?

What is the datatype of the column in the combobox that is being assigned to the textbox?
 
i use the after update of the combo box that is being selected. both of the values are currency.
 
Here is what my code looks like? Is it possible that my data from the combo box is screwing it up?

Private Sub Combo57_AfterUpdate()

[Original Price] = Combo57.Column(1) --these are supposed to be the same value

[Material Surcharge] = Combo57.Column(1) --these are supposed to be the same value

[Heat Treat Surcharge] = Combo57.Column(2)

[Frieght Surcharge] = Combo57.Column(3)

[Packaging Surcharge] = Combo57.Column(4)

[Other Surcharge] = Combo57.Column(5)

[Total Surcharge] = [Original Price] + [Material Surcharge] + [Heat Treat Surcharge] + [Frieght Surcharge] + [Packaging Surcharge] + [Other Surcharge]

End Sub
 
Are any of these fields ever simply empty (Null) rather than holding a zero value? If so, the result of your calculations will be Null (empty field.)

Null plus anything = Null.

You can avoid this by using the Nz() function to assign a zero if the field is Null.

Nz([Total Surcharge], 0) = Nz([Original Price], 0) + Nz([Material Surcharge], 0) and so forth for all the fields.

10 + Null +5 = Null

10 + 0 + 5 = 15
 
i think that there is something wrong with my combo box

i have the data to fill the combo box coming from a query that lists all of the data that i want on the form. When I click on the drop down button for the combo box there isn't formatting on anything. Like currency appears like 3.75 instead of $3.75. Is this a problem when it comes to handling zero values? is there some way that this formatting problem is effecting the zeros?
 

Users who are viewing this thread

Back
Top Bottom