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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my check box wont reset

Status
Not open for further replies.

sandeep0000

Programmer
May 10, 2007
98
US
in my form i have many check boxes and when i check the boxes and click on next record, the checks dont got away how would i do this, im not very strong at access


Private Sub chkReason_not_Aided_AfterUpdate()
If chkReason_not_Aided = True Then

Me.Reason_not_Aided = -1
Else
Me.Reason_not_Aided = 0
End If
End Sub
 
An unbound check box is chancy. What do you wish to do with it? Do you want it to be there when you come back? If not, You can use the Current event of the form to set the checkboxes back.
 
yes, if a person goes back to a previous record i would like to see the checks, but if they go to new record, i would like it blank with no checks, so they can enter new data
 
So, simply use bound check boxes with default value set to false.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
im sorry if i am asking these questions but
how do i make the check box bound

what i did, i click the check box and placed it on my form
then i went to code builder and wrote this

Private Sub chkReason_not_Aided_AfterUpdate()
If chkReason_not_Aided = True Then

Me.Reason_not_Aided = -1
Else
Me.Reason_not_Aided = 0
End If
End Sub

question 1. how do i change my check box to bound.
question 2. in the properties under default value, do i simply type false?
 
You must set the Control Source of the checkbox to the name of a field in the table. I guess you have a Yes/No field Reason_not_Aided?
 
Why TWO controls (chkReason_not_Aided,Reason_not_Aided) for the same underlaying value ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
i have a chkReason_not_Aided and i have a Reason_not_Aided
should i only have one ?

basically all i want is a check box, so in my table , if its checked it gives me 1 and if it isnt it gives me 0
so when i do my reporting, i can do calculations on this field

maybe my example is off the wall and we should even look at it

what do i need to do , to have a check box on my form. and when the person clicks on next record. the check box is reset. but if the person goes back to the previous record, the check box is there with a check. but if they go forward it needs to be reset

maybe i didnt explain it write

i just dont know the coding i need to make this work
 
Please have a look at my post dated 21 Jun 07 16:05.

I said, You must set the Control Source of the checkbox to the name of a field in the table. I guess you have a Yes/No field Reason_not_Aided?
 
ok,

i have check box called ,chkReason_not_Aided
and i have a hidden text box called Reason_not_Aided
the text box is hidden on the bottom of the form

should it be a text box

in the chkReason_not_Aided control source i put Reason_not_Aided. it didnt seem to work.
remember in my code builder i have this

Private Sub chkReason_not_Aided_AfterUpdate()
If chkReason_not_Aided = True Then

Me.Reason_not_Aided = -1
Else
Me.Reason_not_Aided = 0
End If
End Sub
 
Have you got a Yesno field in your table? What is it called?
 
Why a textbox? Does it have a text reason or just 0,-1?
 
Leave it for now. Can you add a YesNo field to your table?
 
im using a sql server table, so my access form is linked to this table and it updates it when new records are entered in the form.

all my check boxes are data_type bit in the sql server table
 
data_type bit in the sql server table
So, they are Boolean fields !
 
is this a problem or do i need to change the field types in sql server?
 
Set the Control Source of the checkbox to Reason_not_Aided.
 
No problem (unless Null values are allowed for it).
Bind your checkbox to this Boolean field, et voilà !

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top