473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Display zero as dash on form while retaining the value of zero?

3
First off I am rather new to this. I am designing an accounting database. I have forms that are based on tables and there are calculations involved. I need to display character of the value that equal 0 as - for display only but I need to retain that actual value of 0 to accomplish the calculations. Displaying the - instead of 0 is standard practice in accounting. Excel allows you to do this and still retain functionality when calculating; MS Access apparently does not. Dos anybody have a suggestion?
Oct 13 '16 #1
4 3169
jforbes
1,107 Expert 1GB
You could use something like this for your TextBox's Format Property: $#,##0.00;($#,##0.00);-;?

This reference might help Custom numeric formats for the Format function (Access custom web app).

Basicly, you get to supply four different formats. The First part of the format up to the semicolon(;) is the Positive Number Format, the second bit between the first semicolon and second is the Negative Number Format, the third bit is what to use for a number that is Zero, the fourth bit is what to use if the number is Null. This is just for display purposes, so the underlying value is unchanged.
Oct 13 '16 #2
pjenks
3
jforbes, Thanks so much for your reply. I get the concept of what you are saying. However, how do I actually do this. When you say the "TextBox's Format Property" is that something you select in the property sheet (if so, where?) or do you select Format tab up top? When I look at the Format tab at top, I cant find a way to customize it as you suggest. Sorry, I told you I am pretty new at this. Thanks again.
Oct 13 '16 #3
pjenks
3
jforbes. I think I got it now. I put the following in the OnLoad event of the form and it worked! It displays the dash but calculates a zero. Thanks for your help.

Private Sub Form_Load()
[Forms]![frm_JVCreate]![Adjustment].Format = "$#,##0.00;($#,##0.00);-;?"
End Sub
Oct 13 '16 #4
jforbes
1,107 Expert 1GB
Glad you got it working.

Another way to set most Properties of a TextBox is by selecting the TextBox and then finding the property in the Property Sheet; the Format property is usually right around the top of the list. If the Property Sheet isn't displayed, you can either right-click on a Control like the TextBox and select Properties or goto the Design Menu and select Property Sheet on the Ribbon.
Oct 13 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: stickdoctorq | last post by:
This is driving me nuts....I can't find a solution that works for the following: --------------- var tbl = document.getElementById("question1b"); var choiceOne = ; var choiceTwo = ; var...
9
by: Otto | last post by:
Hello to all I have a small webserver to switch relais "on" or "off". Aktually when I click on the button "0" or "1" that send the following url to the server : http://192.168.90.11/?3=1...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
30
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform named "sbfrmParts" with a list of parts along with the quantity and price. I have used a text box in the subform's footer and set the control source to "=Sum(*)". I set the...
0
by: BrianDH | last post by:
Hi I have a web form, using vb.net code behind, with a combo box populated with a dataset (Name, ID). What I have found, unlike a windows form, is that if you try to pass a value (ID) into the...
5
by: Stuart | last post by:
Hi all, Iv'e got a page that has a mass amount of input fields, all of which require a decimal figure. To make it easier when it comes to inputting data, I'm trying to setup + and - links that...
25
by: Dave | last post by:
Hello. In trying to get an anchor element to stylistically match an input or button element, I find that the button and input cannot be styled according to the 2.1 CSS spec. For example, I...
2
by: php_Boi | last post by:
i have designed an application that is a dynamic submission form. i have text fields and listboxes. now i am able to retain the values of the listboxes when i populate the listbox "manually"(single...
2
by: Brave | last post by:
I'm hoping someone can help me with a small issue. I have an asp page that displays informaton from an Access database. I want to create a form that allows users to display only data that...
1
by: metalaniac | last post by:
Hi there I am searching for a method of displaying an extra form field, only when a certain option is selected in a drop down box. <label for="staff_status">Status: </label> <select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.