2 MS Access validation Q's

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to prevent entry into a field in Access, using home/student 2007
version. Field name FromDate and field name ThruDate. If i plug in the
validation text [ThruDate]>=[FromDate] i get an error message "Invalid SQL
-cannot use multiple columns in a column level CHECK constraint". How can I
validate so the thru date is always greater than the from date. note: the
from date does increase.

Also, how do I validate a field whereby i want the entry to be in the %
format, and with only a 2 or 3 digits number the % sign. I do not need the
decimal format. I will be entering values such as 90% and 150%. Always with
the % sign. Thanks!
 
First, this newsgroup is about ADP and SQL-Server and has nothing to do with
MDB files.

Second, in your case, you must make the distinction between column
validation rules and table validation rules. As you want to put a
constraint on the combinaison of two or more columns, you add a table
constraint instead of a column constraint: while in design mode, right click
on the *title bar* and choose Properties from the contextual menu to enter
the properties dialog window for the table (instead of the properties dialog
window for one of the columns).

For your second question, I don't know.

Finally, usually column and table constraints is not the best idea.
Instead, you should create a form and put all the validation there. It's
the only way to write complex validation rules.
 
Back
Top