473,379 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Need help setting a validation rule. Microsoft Access

I need help setting a validation rule to accept the values 2021 or 2022 or 2023 (in that order) only.
Apr 15 '22 #1
2 10959
isladogs
455 Expert Mod 256MB
Easy enough to set the validation rule: Between 2021 And 2023
However, I'm unclear what you mean by 'in that order'
The rule just checks if the entered value is valid or not.

If you really want to show a range of valid entries, you could setup a table level lookup field using a combo with a value list for those years in that order. However, table level lookups are definitely not something I would ever recommend.
Apr 15 '22 #2
zmbd
5,501 Expert Mod 4TB
If you really want to show a range of valid entries, you could setup a table level lookup field using a combo with a value list for those years in that order. However, table level lookups are definitely not something I would ever recommend.
Ideally, your users should NEVER work directly with your tables, all data entry should be done thru the user-forms. With that said, I really wouldn't do a table level lookup combo box - can lead to some real issues down the line.

Table level validation is a completely different beast and is something I do quite regularly, using a limit such as isladogs has suggested; provided, that one is sure that there may not be a need in the future to change the table level validation. Would you need to add "2024" at some point?

So the solution Either do this in the query or in the user form.

I've attached a very simple database to illustrate the point.
Normally I would select one of the forms to open on startup; however, I wanted you to be able to see each of the options.
I've put the numbers in the queries and the tbl_years in the order given, however, you can reorder these as needed with with a sort one the tbl_year in the row source or by changing the order in the static list... etc... most flexible either way.
Attached Files
File Type: zip _SimpleDatabase.zip (22.0 KB, 20 views)
Apr 16 '22 #3

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

Similar topics

7
by: Mathew Hill | last post by:
I am a beginner to the more technical aspects of Microsoft Access (2000) and was wondering if any one can help? I have a field in a table called: ADMIN NUMBER This field should have 4...
6
by: Chuck | last post by:
A97. A database has a table: tblA which has a single text field, B. It is a primary field, indexed and no duplicates. It is used as a lookup for table tblC. A form based on tblA is used to add...
17
by: Pam Ammond | last post by:
I need to use Microsoft Access Automation within a Visual Studio 2003 program written in C# for Windows Forms. When a button is clicked in my VS.NET program, I want it to run a Microsoft Access...
5
by: michael.meenan | last post by:
I'm trying to limit the number of records that can have a checkbox clicked. I created a query that counts the number of records with that checkbox clicked and tried to make a form validation...
14
by: ckpoll2 | last post by:
Hello, I have a validation rule in a text box on a form. The rule is that if Combo12 starts with "Credit Hours -*" than only allow numbers less than or equal to 2 in there. Any number of words...
2
by: Amers01 | last post by:
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...
3
by: jasons4u2 | last post by:
i have two fields PROJECT START DATE and PROJECT END DATE. now i want to creat a validation rule so that the Project End Date will be greater than the Project Start Date. Can any one please help...
12
alakazamm
by: alakazamm | last post by:
I am building a database on Access 2000 which include a Customer Details table. In this Customer Details table there is a 'Post Code' field which I am required to make an Input Mask to limit the...
3
by: Harlequin | last post by:
I must start this posing by making the point that I am NOT a VB programmer and I'm something of a Newbie to MS Access. I can program in a number of languages (Java, Javascript, PERL,PHP and TCL) but...
2
by: JKChan | last post by:
Hi, I'm an A2 ICT student in second year of college right now and I am working on my database project as my coursework. Its about a dance school with 4 tables Student, Class, Teacher and Enrolment. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.