Results 1 to 3 of 3
  1. #1
    LouiseRoussel is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    6

    Formatting a "custom input mask" field in Table design

    Quick question.
    Is it possible to format a "custom input mask" so that if no data for a character, the displayed data will not show empty space.
    For example,


    Designing a Primary Key for a MoviesID column under the Table.
    Movie: Start Treck (ST) Category: Science Fiction (SF) Audience: General (G)
    Custom input mask is: >CCCCC-CC-CCCC
    So movie shows up in Datasheet view and Form view as: ST -SF-G
    But if only 2 characters are used in the first part of the mask, I do not want to see empty space.
    Is it possible to format so that no space is used if no character entered?
    Thanks all, I have not done Access since 94 so I'm just getting back into it.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    not so far as I am aware - input masks are by their nature rigid in their requirements. And I don't think the format property has that level of flexibility for text.

    Probably better to have some code in the control afterupdate event to remove spaces

    As a primary key, it does not sound like a good idea anyway. With three chars you are bound to get clashes on film names - and what if the franchise extends to 10 or more films? why not use an autonumber primary key and simply display a calculated value based on category/audience when required.

  3. #3
    LouiseRoussel is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    6

    Thanks, I suspect you are right in this.

    Quote Originally Posted by Ajax View Post
    not so far as I am aware - input masks are by their nature rigid in their requirements. And I don't think the format property has that level of flexibility for text.

    Probably better to have some code in the control afterupdate event to remove spaces

    As a primary key, it does not sound like a good idea anyway. With three chars you are bound to get clashes on film names - and what if the franchise extends to 10 or more films? why not use an autonumber primary key and simply display a calculated value based on category/audience when required.
    Louise's reply: The 5 characters at the beginning of the input mask were to allow students to create up to 5 letters/digits in the first part of the input mask (Movie name). Indeed I thought of combining Format and Custom Input Mask properties (field properties) but too complicated and my research also led me to believe that the mask design is intended to be rigid. The exercice I had designed was intentionally without AutoNumber to get students to create their own ID knowing that the Primary Key would not accept duplicates.
    Thank you again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Set input mask to "000" for a number
    By cottonland in forum Programming
    Replies: 5
    Last Post: 06-24-2016, 10:00 AM
  2. Replies: 6
    Last Post: 06-24-2016, 06:07 AM
  3. Replies: 2
    Last Post: 01-04-2016, 04:44 AM
  4. Replies: 2
    Last Post: 02-27-2015, 10:03 PM
  5. Replies: 1
    Last Post: 09-03-2014, 03:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums