By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Validation rule in Access

P: 1
Dear

Can some one tell how can i put a validation rule like CITddmmyy0001

basically I am preparing a database for my video shop and want that id to be like this

Actually CIT my compny nick name ddmmyy date month and year and 0001 will be auto generated.

I am able to genereate the CIT and 0001 but how can i make ddmmyy to populate everytime i enter a new record.

Thanks
Mar 21 '07 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Dear

Can some one tell how can i put a validation rule like CITddmmyy0001

basically I am preparing a database for my video shop and want that id to be like this

Actually CIT my compny nick name ddmmyy date month and year and 0001 will be auto generated.

I am able to genereate the CIT and 0001 but how can i make ddmmyy to populate everytime i enter a new record.

Thanks
Have the autonumber field separate with just the 0001 etc. Lets call it VidID.

Now add a field and set it's Default Value to

Expand|Select|Wrap|Line Numbers
  1. ="CIT" & Format(Now(), "ddmmyy") & [VidID]
This will only work on new records.

Mary
Mar 21 '07 #2

NeoPa
Expert Mod 15k+
P: 31,342
You may need to format the VidID part too. Like :
Expand|Select|Wrap|Line Numbers
  1. ="CIT" & Format(Date(), "ddmmyy") & Format([VidID], "0000")
Mar 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.