Problem with validation

royalrodger

New member
Local time
Today, 17:07
Joined
Oct 18, 2007
Messages
9
Hey,
I am a beginner with access, but already have a huge number of records.

I am trying to validate data on entry.

I have two fields which need to have a relationship.

One field is a customer number and the other is VIP.

I am trying to create a rule which states that when VIP reads false customer number reads null.

What validation rule and what language can I use to make this happen?

thanks a lot
Royalrodger
 
I would hope you are entering data through a form. If the VIP field is a CheckBox, are you saying that you want to generate an error message if the user trys to uncheck the box?
 
the database contains only one table. Information is entered through the table. It has worked so far. It is not a live database, no users, it is for records only.

I want to have a rule which states that when i check the customer as a vip (vip reads true) they are assigned a number. is this possible?
 
the database contains only one table. Information is entered through the table. It has worked so far. It is not a live database, no users, it is for records only.

I want to have a rule which states that when i check the customer as a vip (vip reads true) they are assigned a number. is this possible?

Yes, you can set a table level validation. For this you might have to create a function to do so, but if you open the table in design view and then click VIEW > PROPERTIES, you will get the dialog where you can enter the table level validation rules. And if you put your mouse in the Validation Rule property and press the F1 key you will get help on the subject, including examples.

However, it really isn't all that hard to quickly, using the wizard, create a form to do the input with (and then the validation becomes a little easier to accomplish).
 
I am trying to create a function at the moment.

The field I want to be set to null is an autonumber non-primary indexed field. I think this may be the problem.

Is the expr1 meant to be replaced with the field name?

Again, I am trying to create a null value for the customer number field when VIP check box is false or unchecked.

Anyone possibly could give me an example of an expression?

thanks for help so far.
 
I am trying to create a function at the moment.

The field I want to be set to null is an autonumber non-primary indexed field. I think this may be the problem.

Is the expr1 meant to be replaced with the field name?

Again, I am trying to create a null value for the customer number field when VIP check box is false or unchecked.

Anyone possibly could give me an example of an expression?

thanks for help so far.

You can't set an autonumber to null. When a record is created it assigns the number and it can't be removed without removing the record.
 

Users who are viewing this thread

Back
Top Bottom