Form Default Value Question

Posted on 2012-09-04
Last Modified: 2012-09-04
I understand the concept in creating a default value for new form records when the data type is text, but i can't seem to get the same default value to populate when the data type is number.  

For a text field under the form field's property sheet, i add the default in the default value with quotes around the value.  For instance "00000", but if i do the same thing for a number data type field is only inputs one zero?  What is the process for having multiple zero's populate as a default when the data type is number.  The zero's are proceeding to employee ids so i want them inputted so the complete naming convention is utilized when entering the remaining numbers.  

Question by:jsawicki
    LVL 119

    Expert Comment

    by:Rey Obrero
    <What is the process for having multiple zero's populate as a default when the data type is number.>

    if your intention is to have your field zero filled, you need to convert the field to string with


    or use a Data Type TEXT, not Number

    Author Comment

    So that code will go into the default value on the property Sheet under the data tab.  If so, i added it, changed the data type to number and left the field size long integer.  THe results was the field  populating with #Name?
    LVL 119

    Accepted Solution

    here is another way of doing it
    open table in design view
    select your number field
    below, look for the format property and type  00000

    now create a form bound to the table..
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    Then I am confused as to why you are asking about "default values", when your question appears to be about "Formatting"

    In addition to what capricorn1 posted, you can also:

    In the table, set the "Format" Property of this numeric field to: 000000
    (Note that there are no quotes around the zeros)
    Then any number you enter in the field will have the leading Zeros.
    set the format propertyenter a valueformatted with leading zeros
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    Ignore my post above, capricorn1 posted the same thing before I did, so he should get the points.

    But my point is still valid.
    This is "Formatting", it has nothing to do with "default values"

    What you seem to be wanting here is a "Default Format", ...not a Default Value...


    Author Closing Comment

    Thanks all.  I was just trying to understand the possibility of entering a default value while using data type number and have realized that it works unless the numbers are all zeros then you have to convert to a string.  When it is zeros, it will only list one versus all that are listed.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now