Validation rule on Boxes

therock003

Board Regular
Joined
Jan 9, 2008
Messages
183
I am experimenting with a new database i just created in Access 2k7 in order to get the grasp of things.

I have created a checkbox field, and i'm trying to set a validation rule, that checks another fields value, and if the value is not the one i set, then the checkbox cannot be applied.

So far this is what i've come up with, but it return invalid syntax

Code:
[Field1] Not "Value1" = False

That means that if the value inside Field 1 is anything else but "Value1" then the checkbox cannot be true (checked).

Could anyone please convert this syntax into a working one? Thank You. :)
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I am experimenting with a new database i just created in Access 2k7 in order to get the grasp of things.

I have created a checkbox field, and i'm trying to set a validation rule, that checks another fields value, and if the value is not the one i set, then the checkbox cannot be applied.

So far this is what i've come up with, but it return invalid syntax

Code:
[Field1] Not "Value1" = False

That means that if the value inside Field 1 is anything else but "Value1" then the checkbox cannot be true (checked).

Could anyone please convert this syntax into a working one? Thank You. :)

If this can be applied to a form you can use the form events and proberbly the best one would be on current (meaning current record)

so the field code would be like this:

If me.FieldName.value ="Value1" then
me.checkboxname=true
else
me.checkboxname=False
End IF

Trevor G
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top