Results 1 to 14 of 14
  1. #1
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69

    Making an input mask permanent when stored

    Hey guys,

    Is there a way to make my input mask permanent when it is stored in my table?



    So my input mask is !A\-00\-000;;_

    and now I'm trying to write a search query that will search these records but I can't figure out how to make the dashes (-) permanent. When I do my search I want to type in X-12-123 not X12123. I know the back slashes made the dashes literal, and they appear in the table, but it's still as if they are just there for show and nothing else. Any tips? Thanks!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Data is stored in tables according to the field's data type not because of formatting or input masks. Have you tried using an input mask on your unbound textbox, the control used for the search?

  3. #3
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    I didn't think of that- I like that idea. Thanks I'll try that now.

  4. #4
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    Do I change the input mask of each piece of the query that has criteria by going to properties? I tried this and it didn't make any difference.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Input masks are used to help the developer control what a User inputs into a field of type Text. As you can see, the data stored is what the user types. If the user types into an unbound textbox that employs the same input mask previously used, you can use this data for your query.

  6. #6
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    I don't really follow. The user is filling out my form -> the form has an input mask -> The data is stored in the tables and the input mask is still present.

    Now I'm creating a query to search through this table. -> the query prompts the user to enter the number. -> I want the input mask to again display here.

    It didn't do it by default, it didn't work when I added an input mask to each piece of the query that had the criteria of [Enter Number], is there somewhere else I have to put the mask?

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am not sure you can use an input window from a parameterized query to accept an input mask. Did you create your query in a way to prompt the user for input? If so, I suggest you do not use this technique and, instead, use an unbound text box in a custom "Search Form". Place your input mask in the properties of the unbound text box.

  8. #8
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    Yeah I created a query that prompts the user to type in a number and then a report is generated based off of the input number. I would rather figure out how to make the input mask I already have working permanent. Is there a way to make the input mask appear on my form like it does now, but be permanent in my tables as if I had typed it all out? What's happening is I'm using my search query/ report thing I just mentioned but the dashes in my tables arent recognized by the search. The table shows X-12-123 but if I want to search it I have to type X12123.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    An input mask can be set to save the punctuation with the input if you want. To do so change the input mask to:

    !A\-00\-000;0;_

    That will force the dashes to be saved. It will not change existing data. You will have to edit it.

    http://msdn.microsoft.com/en-us/libr...ffice.15).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    I've tried that but it made no difference. I found that by adding the 0 in the second section it was the same thing as putting the back slashes in. It made the dashes literal and they appeared in my table, but when I got to the table they still won't allow me to edit them and thus they won't appear as part of my search.


    Second Specifies whether Microsoft Access stores the literal display characters in the table when you enter data. If you use 0 for this section, all literal display characters (for example, the parentheses in a phone number input mask) are stored with the value; if you enter 1 or leave this section blank, only characters typed into the control are stored.
    \ Causes the character that follows to be displayed as the literal character (for example, \A is displayed as just A).



    Same thing correct?

  11. #11
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    So I understand that if I take away my input mask my table is going to look like X12123 etc... and I don't want to have to type in the dashes initially and for every entry... so my question is, is there a way to make the input mask "typed in" rather than just some formatting thing for show only?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    No, I don't read that as the same thing. If the literal static text (your hyphens) is saved with the data then removing the input mask will not remove the hyphens. The hyphens are part of the stored value and must be typed when entering search criteria.

    I never set properties like lookups, format, input mask in table. So I can do whatever I want with table data and I see the actual data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    According to post #9, you can save the dashes as part of your literal text. I have never tried this approach. Perhaps you can review the link provided and try it again. Note (like June mentioned) that previously stored data does not change when an input mask is edited.

  14. #14
    tc197 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Jun 2014
    Posts
    69
    My apologies I think where I screwed up was with the previously stored data. Your solution from Post 9 actually works wonderfully and I got lost in the wording. Earlier before I started the thread I had tried this same approach but I didn't see any changes due to the fact I wasn't entering in new data to test. Thank you for the support and for not getting frustrated with me. I appreciate the help very much!
    Last edited by tc197; 07-02-2014 at 05:40 AM.

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

Similar Threads

  1. Replies: 17
    Last Post: 04-14-2014, 11:44 AM
  2. Input mask
    By scorpion99 in forum Access
    Replies: 4
    Last Post: 02-21-2014, 02:18 AM
  3. input mask
    By slimjen in forum Forms
    Replies: 7
    Last Post: 10-07-2013, 03:20 PM
  4. Input Mask
    By qbc in forum Access
    Replies: 2
    Last Post: 01-20-2012, 03:27 PM
  5. Input mask
    By doobybug in forum Access
    Replies: 2
    Last Post: 06-17-2009, 09:40 PM

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