Urgent! problem in bounded check box in a continuous form

jydbman

Registered User.
Local time
Today, 13:11
Joined
Nov 23, 2007
Messages
40
Hi Gurus,

My project will be due by the end of this month. It is an urgent request for your help.

I have a continous form uses a table as a record source. All of the text boxes are bounded to fields in the table. There is a check box also bounded to on Yes/No field in the table. I disabled all of the text box and just leave the check enable. My intention is to allow use to check the check box and it will update the Yes/No field to "True", then in turn, insert that record with the field value true to another table. I just found out that method only work for the first row in the continuous form. If I check the check box at the 2nd row, it did not work. How can I overcome that? How to make it work for the other rows beside the 1st row?

Thank you very much !

jydbman
 
How have you enabled the text box from the checkbox? What code?
 
thanks for responding.

How have you enabled the text box from the checkbox? What code?
Bob,
Thanks for responding.
No. I don't want to enable the text box from the checkbox.
Do I need to enable the text box to make it work?
The code is like the following. (the original SQLs are too long, here I make a short one to make it easier to read.) The SQLs should not be a problem, since I can check the checkbox in the first row and works fine. Thank you!

Private Sub chkkeep_Click()

DoCmd.SetWarnings False
If Me.Dirty = True Then Me.Dirty = False

DoCmd.RunSQL "update datatemp set keep=true where result= " & Me.txtresult.Value & " and length=" & Me.txtlength.Value & ";"
DoCmd.RunSQL "insert into tempkeep select * from datafinal where length=" & Me.txtlength.Value & ";"
DoCmd.RunSQL "delete from datafinal where length=" & Me.txtlength.Value & ";"
DoCmd.RunSQL "insert into datafinal (ldate, length, test, result) select ldate, length, test, result from datatemp where length=" & Me.txtlength.Value & " and result= " & Me.result.Value & " and keep=true;"
DoCmd.RunSQL "insert into tempkeep (ldate, length, test, result) select ldate, length, test, result from datatemp where length=" & Me.txtlength.Value & " and result= " & Me.result.Value & " and keep=true;"

DoCmd.RunSQL "delete * from datatemp;"

DoCmd.SetWarnings True
Me.Requery
Me.Refresh
Me.Repaint
End Sub

jydbman
 

Users who are viewing this thread

Back
Top Bottom