Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox on Forms

Status
Not open for further replies.

zs450

IS-IT--Management
Jul 17, 2002
36
US
Feel free to laugh, but, how do I place a checkbox on a form that will input a value "y" or "n" or "whatever I choose" into my table when checked and remove it when unchecked?
I know that this is a relatively simple procedure and I may have my IT status revoked, but, I need to know how to do this.
 
Are you trying to store a value in a field that is bound to the check box, or store a value in a different field that isn't bound to the check box?

Example: Your table contains two fields:

ckbox, Type Yes/No
cboxText, Type Text

If the check box on your form is selected, do you want to store text in cboText?

Or do you want to store data in ckbox? I don't think that you can do this, but maybe someone knows a way. dz
dzaccess@yahoo.com
 
zs450,
There are several ways to go about this. I'll try.
1. in table make data type of the field name Yes/No
2. on form create a check box by draging from tool bar
3. on form make sure the Control Source is the field name and size it as you wish.
4. on form you can also make the default value o, this way when the form is opened, there won't be any grayed boxes.

Also, check help for check box.

I don't see any reason to laugh. Why waste time to ask a question if you already know the answer.


HTH
Maurie
 
In my table, I have a field that requires a Y or N entry. I created the form and when I put the checkbox on the form, I can click it off and on, but, I cannot get it to affect the field at all.
What I want it to do it input a y when it is on and remove it when it is off.
 
You seem to have 2 delimias here. Is the check box bound? If so, and you check it and get nothing in the table .... that doesn't make sense. A check or Yes is a -1 and a cleared box, or no is a 0. It could also be null (that is why I suggested using a 0 in the defualt. If you actually want a user to put a Y or N on the form you will need a text box instead. If so, change the data type in the table to text and make Field Size (below) 1.

HYH

Maurie
 
The way that Access stores a boolean field in a table isn't relevant to anything. You can display anything that you want on a form depending on whether the value of the boolean is true or false. If you want to reflect changes made to the field on the form in the table, the field on the form either has to be Bound to the field in the table, or you have to manually set the value in the table when the check box changes. Is this what you are trying to do? dz
dzaccess@yahoo.com
 
Thanks for all of the help everyone. I'm going to give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top