Checkbox to activate textbox input

M

Mike

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html
 
M

Mike

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


Beetle said:
You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


Mike said:
Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


Mike said:
Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


Beetle said:
You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


Mike said:
Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
M

Mike

The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

Beetle said:
Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


Mike said:
Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


Beetle said:
You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


Mike said:
The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

Beetle said:
Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


Mike said:
Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
M

Mike

Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

Beetle said:
Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


Mike said:
The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

Beetle said:
Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

Open the properties sheet for the checkbox, go to the data tab, and make
sure that;

Enabled = Yes
Locked = No
--
_________

Sean Bailey


Mike said:
Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

Beetle said:
Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


Mike said:
The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

:

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
M

Mike

Yes that is exactly what I see on the properties for the checkbox. Is there
something else that I may be missing or overlooking?


Mike

Beetle said:
Open the properties sheet for the checkbox, go to the data tab, and make
sure that;

Enabled = Yes
Locked = No
--
_________

Sean Bailey


Mike said:
Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

Beetle said:
Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


:

The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

:

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

Actually, I'm a little baffled myself as to why your checkbox is not
updateable. You might try deleting that checkbox from your form,
then create a new one with the same name. The After Update code
that you put in earlier should still be there, but you may need to re-link
the code to the new checkbox. You can do this by opening the properties
sheet for the new checkbox and clicking the elipse for the After Update
event. This should open the VBA window to the existing After Update code,
then you can just close the window, and the code should be linked to the
new checkbox, as long as the new checkbox has the exact same name
as the old one.

Before you re-link the code, make sure you can check/uncheck the new
checkbox, then verify this again after you re-link the code.

--
_________

Sean Bailey


Mike said:
Yes that is exactly what I see on the properties for the checkbox. Is there
something else that I may be missing or overlooking?


Mike

Beetle said:
Open the properties sheet for the checkbox, go to the data tab, and make
sure that;

Enabled = Yes
Locked = No
--
_________

Sean Bailey


Mike said:
Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

:

Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


:

The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

:

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
M

Mike

My mistake! I found the issue. There was nothing wrong with what you had
given me, it was the code that I was editing in the VBA. The reason it wasnt
working was because of the following code:

If Me![RespAddAvail] = True Then
Me![RespAddress].Enabled = True
Me![RespCity].Enabled = True
Me![RespState].Enabled = True
Me![RespZip].Enabled = True
' etc. for any other controls you want to add
Else
Me![RespAddress].Enabled = False
Me![RespCity].Enabled = False
Me![RespState].Enabled = False
Me![RespZip].Enabled = False
' etc. for any other controls you want to add
End If

And if you look closely under the "Else" statement that first line should
not be there. Once I looked at it with a clear mind I saw it right away,
then tested it. Thanks soo much Sean, you are a true Access genius!!!!

Regards,
Michael

Beetle said:
Actually, I'm a little baffled myself as to why your checkbox is not
updateable. You might try deleting that checkbox from your form,
then create a new one with the same name. The After Update code
that you put in earlier should still be there, but you may need to re-link
the code to the new checkbox. You can do this by opening the properties
sheet for the new checkbox and clicking the elipse for the After Update
event. This should open the VBA window to the existing After Update code,
then you can just close the window, and the code should be linked to the
new checkbox, as long as the new checkbox has the exact same name
as the old one.

Before you re-link the code, make sure you can check/uncheck the new
checkbox, then verify this again after you re-link the code.

--
_________

Sean Bailey


Mike said:
Yes that is exactly what I see on the properties for the checkbox. Is there
something else that I may be missing or overlooking?


Mike

Beetle said:
Open the properties sheet for the checkbox, go to the data tab, and make
sure that;

Enabled = Yes
Locked = No
--
_________

Sean Bailey


:

Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

:

Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


:

The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

:

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 
B

Beetle

Glad you found your issue. I appreciate the complement, but you are
mush too kind.

Access genius? Not really. Just someone trying to help where I can. :)
--
_________

Sean Bailey


Mike said:
My mistake! I found the issue. There was nothing wrong with what you had
given me, it was the code that I was editing in the VBA. The reason it wasnt
working was because of the following code:

If Me![RespAddAvail] = True Then
Me![RespAddress].Enabled = True
Me![RespCity].Enabled = True
Me![RespState].Enabled = True
Me![RespZip].Enabled = True
' etc. for any other controls you want to add
Else
Me![RespAddress].Enabled = False
Me![RespCity].Enabled = False
Me![RespState].Enabled = False
Me![RespZip].Enabled = False
' etc. for any other controls you want to add
End If

And if you look closely under the "Else" statement that first line should
not be there. Once I looked at it with a clear mind I saw it right away,
then tested it. Thanks soo much Sean, you are a true Access genius!!!!

Regards,
Michael

Beetle said:
Actually, I'm a little baffled myself as to why your checkbox is not
updateable. You might try deleting that checkbox from your form,
then create a new one with the same name. The After Update code
that you put in earlier should still be there, but you may need to re-link
the code to the new checkbox. You can do this by opening the properties
sheet for the new checkbox and clicking the elipse for the After Update
event. This should open the VBA window to the existing After Update code,
then you can just close the window, and the code should be linked to the
new checkbox, as long as the new checkbox has the exact same name
as the old one.

Before you re-link the code, make sure you can check/uncheck the new
checkbox, then verify this again after you re-link the code.

--
_________

Sean Bailey


Mike said:
Yes that is exactly what I see on the properties for the checkbox. Is there
something else that I may be missing or overlooking?


Mike

:

Open the properties sheet for the checkbox, go to the data tab, and make
sure that;

Enabled = Yes
Locked = No
--
_________

Sean Bailey


:

Yes it is enabled when I am creating a new one and even when creating a new
record it still doesnt allow me to option yes or no on that checkbox. There
is no other code on this form. I've looked around to see anything that may
lead to this output but I'm all out of ideas.

:

Is it enabled when you are creating a new record? Is there any other code
behind your form that might be disabling the checkbox if you're not on a
new record (or something)?
--
_________

Sean Bailey


:

The checkbox itself is disabled and I cannot edit it on the form. If I want
to go back and change it from unchecked to checked it doesnt allow me to.

:

Are you saying that the checkbox itself is disabled and you can't change it's
value, or that you can change the checkbox but the other controls don't
become enabled when you do?
--
_________

Sean Bailey


:

Hey Sean! Thanks so much for replying in regards to my issue. It seems to
work great except for one thing. If in case the use wants to go back to a
particular record and change the checkbox from unchecked to checked, the form
wont allow me to edit that checkbox. Is there a work around for this?


:

You can add some code to both the Current event of your *form* and
the After Update event of your *checkbox*. The code would look similar
to this (modify control names to fit your app).

If Me![yourcheckbox] = True Then
Me![Name].Enabled = True
Me![Address].Enabled = True
Me![City].Enabled = True
' etc. for any other controls you want to add
Else
Me![Name].Enabled = False
Me![Address].Enabled = False
Me![City].Enabled = False
' etc. for any other controls you want to add
End If

Again, this code should go in your forms Current event and your checkbox
After Update event. Open the properties sheet, got to the event tab, then
click the elipse next to the appropriate event an select code builder.

BTW - Name is a reserved word in Access and should not be used as a field
or control name. Actually, your name field should probably be split into
separate fields for FirstName and LastName (and MiddleName, etc. if you
use those). you can see the following link for more on reserved words.

http://allenbrowne.com/AppIssueBadWord.html

--
_________

Sean Bailey


:

Hi I have a table that contains basic information about a customer. Fields
like Name, Address, City, State, etc... I've also created a "yes/no" field
within this table to designate whether or not this customer has an address
available. Taking the fields to the form when the user is inputting this
data, I would like it in such a way that if the checkbox is not selected then
the user cannot input the address, city, state, etc. If the checkbox is
selected this should enable the user to input the customer's address, city,
state, etc. Is this possible and if so how would i go about creating this?
Thank you in advance.
 

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