Results 1 to 13 of 13
  1. #1
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179

    Form Entry Field Format

    Hello,



    Is there a way to only allow a certain format in a text field?

    There is a field for test equipment that the user will enter the number and if there are more numbers only allow comma then space to separate them for instance:

    222, 3258, 179, 88, 61

    * It is important to have the space so that if we need to search for a history of that test equipment it can be done. If there isn't a space then it will be like searching for:

    222,3258,179,88,61

    This would be like searching for the whole sequence of numbers and commas.

    I hope you understand my dilemma and thank you so much for your help,
    Bill

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Rules of Normalization would say not to store more than one distinct piece of information in a field, and you're seeing why. Normally these would be stored in a related table, with each being a separate record. It would be difficult for you to search on "88" and not get "888" as well, that type of thing.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    So without having a separate table this will have to do for this field. It is a minor point to have spaces between commas to separate the numbers.

    Thanks for the information pbaldy.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem, good luck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Is this still possible to do though?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Probably, but I think you're jumping through hoops to work around the design issue. They will be searching on individual numbers, right? Like the 88 in your example? I assume you're getting around the 88 finding 888 issue by searching for " 88"? How would that work for the first record, which won't have a space in front of it? Or the last which won't have a comma after? I feel like however you try to search there will be a hole in the logic.

    You could let them enter in that format but then create properly normalized records from that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Okay I just want them to enter them consistently. When I looked through our backend of the last few years sometimes the user puts no spaces between commas, 1 or 2 or 3 spaces between, and even sometimes they use periods, asterisks, or right and left arrows.

    I am dealing with people that don't care about details so I have to constantly check on the data.

    This is why I asked about this issue.

    Thanks for any help or suggestions

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The keypress code I gave you on the other thread can be reversed to allow whatever the desired characters are and ignore the rest. I guess you could do that, ignore spaces and all the other odd characters, then in the after update event use the Replace() function to replace a comma with a comma and a space.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    There will only be numbers and commas so can that work?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Sure, you just define the ascii values you want to let through. I'm just on a phone at lunch so don't have code handy.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Thanks anytime you can spare. I really appreciate the help.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Looks like you have this crossposted and decided to leave it alone?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    I was trying to get other opinions from the other forum sorry. I will only use the other forum now but I do appreciate all of the help.

    I am under pressure to get this new database ready for deployment and I will try to work as long as I am able.

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

Similar Threads

  1. A Form field properties depend on Yes/No field entry
    By rscott7706 in forum Programming
    Replies: 3
    Last Post: 02-21-2018, 02:54 PM
  2. Replies: 1
    Last Post: 12-28-2016, 11:39 AM
  3. Replies: 4
    Last Post: 03-12-2013, 06:49 PM
  4. Date Entry in one format display in another
    By mikethebass in forum Forms
    Replies: 1
    Last Post: 01-22-2012, 05:34 PM
  5. Data Entry Format
    By jlgray0127 in forum Forms
    Replies: 7
    Last Post: 10-31-2011, 04:04 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