How to show a zero on a form textbox field? (1 Viewer)

BadBoy House

Registered User.
Local time
Today, 10:45
Joined
Oct 8, 2009
Messages
54
Hi all,

Could anyone tell me how to make a text-box field on a form display a zero?

We have a form linked to a table on our jobs database and I need the ProposedFinalBillAmount field on the form to display a zero.

The field on the table displays 0.00 which is fine, however the form clears a zero if you type one in:



Sometimes the bill amount will be zero so we need to display this in the text box.

Thanks in advance.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:45
Joined
Sep 21, 2011
Messages
14,038
Check the format property of the control?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:45
Joined
Aug 30, 2003
Messages
36,118
What's the Format property of the textbox?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:45
Joined
May 7, 2009
Messages
19,169
as Gasman said it.
on design view of your form, select the textbox.
on its Property->Format->Format, you can put:

;;0;0
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:45
Joined
Oct 29, 2018
Messages
21,357
The field on the table displays 0.00 which is fine, however the form clears a zero if you type one in:
The form shouldn't "clear" a zero (0) as a default behavior. So, either the format property has something to do with it or you may have some code running that clears it.
 

Micron

AWF VIP
Local time
Today, 06:45
Joined
Oct 20, 2018
Messages
3,476
By chance you are hitting enter and wrapping the 0 entered on to a new line?
To facilitate zero the textbox default value property could be set to zero or zero could be the default value in the table field, assuming it's numeric.
 

BadBoy House

Registered User.
Local time
Today, 10:45
Joined
Oct 8, 2009
Messages
54
The format property of the textbox on the form is currently #;-#;"";"".

If I change it to ;;0;0 it causes strange behaviour when clicking in the text box.

I tried changing the format to General Number but this then omits the decimal places.

I then set the format property to Standard (don't know why I didn't try this before) and it seems to have sorted it.

Many thanks!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:45
Joined
Oct 29, 2018
Messages
21,357
The format property of the textbox on the form is currently #;-#;"";"".

If I change it to ;;0;0 it causes strange behaviour when clicking in the text box.

I tried changing the format to General Number but this then omits the decimal places.

I then set the format property to Standard (don't know why I didn't try this before) and it seems to have sorted it.

Many thanks!
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom