Jump to content

Access data validation rules (input masks)

yo i have a weird question... Anyone here real familiar with data validation rules in access?
 
basically i wanna make it so that the first character of the "customer ID" must be the capital letter at the start of the "customer name".
 
then the next 4 characters need to be the last 4 digits of the customer's "social security number"
 
The stuff in quotes are existing fields, all of which have data validations of their own (ie first letter of "customer name" must be capital)
Link to comment
Share on other sites

Link to post
Share on other sites

My Access knowledge is a little rusty, since I haven't used it in over a decade, so I'm not sure I'm all that helpful, but what exactly is your goal here? Do you want a field that the user can type something in that must conform to those rules? So if you want to add me as a customer (take my username as my name in this example) and my SSN is 123-45-6789 (totally arbitrary example, not a valid number, obviously), would a user have to manually type in A6789 into that field and the field would validate the input? Or should it happen automatically that it gathers all the info from the name an SSN fields and populates the target field with the appropriate data? Also, is the "customer ID" field only supposed to contain that information or some additional stuff as well?

 

If you want the automatic option, you'd probably need to write a VBA script that automatically triggers, either every time the "customer name" field or the "social security number" field is changed or whenever you exit the field.

And now a word from our sponsor: 💩

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×