Default Value of a Text Box

M

molsonexpert

This should be simple, but I'm trying to figure the easiest way to do this:
I have a text box on a form that's bound to a field in a table; it's data
type is currency and default value is 0. A user enters a value which is used
later on the same form in a calculation. If a user tabs into the control,
clears the value, but doesn't enter anything, it becomes blank, and then
messes up the calculation later on. How do I ensure a value remains in this
control (if the user enters nothing, it should revert back to $0.00)?

thanks.
 
F

fredg

This should be simple, but I'm trying to figure the easiest way to do this:
I have a text box on a form that's bound to a field in a table; it's data
type is currency and default value is 0. A user enters a value which is used
later on the same form in a calculation. If a user tabs into the control,
clears the value, but doesn't enter anything, it becomes blank, and then
messes up the calculation later on. How do I ensure a value remains in this
control (if the user enters nothing, it should revert back to $0.00)?

thanks.

There is no need to have it 'revert back' to 0.
Use the Nz() function to do your calculation.

=Nz(Field1,0) + Nz([field2],0) + Nz(etc...)

Look it up in VBA help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top