Search code examples
stringms-accessvbaintegerconcatenation

displaying integer separated VBA in Access form


I am creating a form where I need to display an identifying number separated by "-" e.g I have an Identification number 1122313 and need to display it as 11-22-313 in a textbox in the form The number is declared as long integer in the form's control source table.


Solution

  • On the form you have created, in the detail section (I assume), where you plan to display the number field with "-" between certain digits, locate the textbox control that you plan on using, then do the following:

    1. View the properties for the textbox control (I assume you are using a textbox).
    2. Locate the Format property (3rd down iv viewing all properties)
    3. Enter the following value (without the quotes): "00-00-000"
    4. Save the form changes, then view the results.