Checkbox required

J

Julius

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
C

Curis

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff
 
J

Julius

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.
 
C

Curis

I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff
 
J

Julius

Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

Curis said:
I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

Julius said:
Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.
 
C

Curis

D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

Julius said:
Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

Curis said:
I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

Julius said:
Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
J

Julius

Thank you so much for all your help in this. I am affraid I still have a bit
of an issue, I did exactly what you said at the table level and this is the
error I am getting.

Invlaid SQL Syntax - cannot use multiple columns in a column-level CHECK
constraint.

Please advise.

Curis said:
D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

Julius said:
Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

Curis said:
I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

:

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
J

Julius

Also I am not using an ADP (Access Database Project) if that is what ADP
means. I looked at my table properties and I do not have an option to change
my constraints. Really could use some simple terms to fix this.

Julius said:
Thank you so much for all your help in this. I am affraid I still have a bit
of an issue, I did exactly what you said at the table level and this is the
error I am getting.

Invlaid SQL Syntax - cannot use multiple columns in a column-level CHECK
constraint.

Please advise.

Curis said:
D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

Julius said:
Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

:

I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

:

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
C

Curis

OK, we are almost there (assuming that, in the end, this is the fix you are
looking for).

I should have clarified. When I said to apply the validation rule at the
table level, I meant in the properties of the actual table, not the field.
When in the design view of the table, if you right-click the blank box
directly to the left of the "Field Name" column, you can then select
Properties from the menu. Also, if you have not done so already, remove that
validation rule from each of the checkbox fields.

Within those properties, you will see another area in which to apply a
validation rule. If you copy and paste that bit of code into that Validation
Rule setting, it should work--it does for me within my test database, in any
case.

With fingers crossed...

-Jeff

Julius said:
Thank you so much for all your help in this. I am affraid I still have a bit
of an issue, I did exactly what you said at the table level and this is the
error I am getting.

Invlaid SQL Syntax - cannot use multiple columns in a column-level CHECK
constraint.

Please advise.

Curis said:
D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

Julius said:
Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

:

I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

:

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
J

Julius

Ok, still not working. I did exactly as you requested. I went to the table
properties and put in the following: (Not IsNull([PhoneTechnique1]) And Not
IsNull([NoPhoneTechnique1])) And ([PhoneTechnique1] = Not
[NoPhoneTechnique1]), then I went into the after update event for the
checboxes and did this: [PhoneTechnique1] = [NoPhoneTechnique2]. I have 30
Yes/No checkboxes, the above method does not allow me to use different
checkboxe names when I go into the table properties. Also I get a message
that says Can't find the macro 'PhoneTechnique1] = [Not NoPhoneTechnique2.'
when I do the above, I go to my form to save it to is if it will ask me to
put a checkmark in the box


Curis said:
OK, we are almost there (assuming that, in the end, this is the fix you are
looking for).

I should have clarified. When I said to apply the validation rule at the
table level, I meant in the properties of the actual table, not the field.
When in the design view of the table, if you right-click the blank box
directly to the left of the "Field Name" column, you can then select
Properties from the menu. Also, if you have not done so already, remove that
validation rule from each of the checkbox fields.

Within those properties, you will see another area in which to apply a
validation rule. If you copy and paste that bit of code into that Validation
Rule setting, it should work--it does for me within my test database, in any
case.

With fingers crossed...

-Jeff

Julius said:
Thank you so much for all your help in this. I am affraid I still have a bit
of an issue, I did exactly what you said at the table level and this is the
error I am getting.

Invlaid SQL Syntax - cannot use multiple columns in a column-level CHECK
constraint.

Please advise.

Curis said:
D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

:

Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

:

I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

:

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 
J

Julius

Can someone help me with this, its been almost three weeks and I have not had
any additional answer for my issue. I really need to resolve this if it can
be.

Julius said:
Ok, still not working. I did exactly as you requested. I went to the table
properties and put in the following: (Not IsNull([PhoneTechnique1]) And Not
IsNull([NoPhoneTechnique1])) And ([PhoneTechnique1] = Not
[NoPhoneTechnique1]), then I went into the after update event for the
checboxes and did this: [PhoneTechnique1] = [NoPhoneTechnique2]. I have 30
Yes/No checkboxes, the above method does not allow me to use different
checkboxe names when I go into the table properties. Also I get a message
that says Can't find the macro 'PhoneTechnique1] = [Not NoPhoneTechnique2.'
when I do the above, I go to my form to save it to is if it will ask me to
put a checkmark in the box


Curis said:
OK, we are almost there (assuming that, in the end, this is the fix you are
looking for).

I should have clarified. When I said to apply the validation rule at the
table level, I meant in the properties of the actual table, not the field.
When in the design view of the table, if you right-click the blank box
directly to the left of the "Field Name" column, you can then select
Properties from the menu. Also, if you have not done so already, remove that
validation rule from each of the checkbox fields.

Within those properties, you will see another area in which to apply a
validation rule. If you copy and paste that bit of code into that Validation
Rule setting, it should work--it does for me within my test database, in any
case.

With fingers crossed...

-Jeff

Julius said:
Thank you so much for all your help in this. I am affraid I still have a bit
of an issue, I did exactly what you said at the table level and this is the
error I am getting.

Invlaid SQL Syntax - cannot use multiple columns in a column-level CHECK
constraint.

Please advise.

:

D'oh! I missed the closing parentheses at the end of the first half of the
rule. Sorry about that. It should be:

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2])) And ([CheckBox1] = Not
[CheckBox2])

See if that does it.
-Jeff

:

Thank you so much for your help, I think we are almost there. I get a
message saying that a bracket or parenthis is missing, I am not sure I look
at your string and I can not determine where it is missing. Also, you are
right it should have been one checkbox. However this was created many
thousands of moons ago. I work for a Call center where we do audits, and the
checkboxes are linked to fields that calculate values, its a twisted sister
how its setup but I made the best of it. Anyway thank you very much and if
you can tell me where the bracket or parenthis go I would greatly appreciate
it.

:

I believe I misunderstood your original post. If so, I apologize.

After re-reading, it sounds like you have two checkboxes, and neither can be
the same value as the other. In other words, if Checkbox1 is True, then
Checkbox2 must be False, and neither can be null.

If so, then you must apply a validation rule at the table level (you could
also do something at the form level, if you prefer). Go to the properties of
the table, and in the Validation Rule enter (replacing field names as needed,
obviously):

(Not IsNull([CheckBox1]) And Not IsNull([CheckBox2]) And ([CheckBox1] = Not
[CheckBox2])

I believe this will accomplish what you want.

In addition, you may want to include a bit of code in the AfterUpdate event
of each CheckBox on the form saying that [CheckBox1] = [Not CheckBox2].

All that said, though, I am not sure of the purpose of having two separate
checkboxes if one's value will *always* be the opposite of the other. Cannot
value 2 be inferred from value 1 using only one checkbox?

In any case, give that a shot.
Jeff

:

Not sure what I am doing wrong, I change the checkboxes TripleState to Yes
and I applied a Validation Rule to say Is not Null and it the form still
allows me to save without asking for a checkmark in either box. I changed
this in the properties of the yes and no checkboxes, I even tried changing it
in the table where the field is.

:

You can set the TripleState of the CheckBoxes to Yes, and then apply a
Validation Rule to the field that says Not Null.

Jeff

:

I have a form with Yes/No Checkboxes that I want to make required fields.
The catch is I don't want null values I want the user to have to check Yes or
No. I am affraid if I make both required then even if I check the Yes box
the user will be prompt to check the no box. How do I make my checkboxes a
required field with only having to input checkmark in either yes or no. This
is a urgent request. Can someone help me please.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top