Validation rule on Boxes

therock003

Board Regular
Joined
Jan 9, 2008
Messages
176
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. :)
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,701
Office Version
  1. 2016
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,057
Messages
5,599,550
Members
414,316
Latest member
ExcelLee

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
Top