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

reset yes/no field (uncheck boxes) 2

Status
Not open for further replies.

SNicholls

Technical User
May 13, 2004
22
US
My users open a table and click on a yes/no field to select rows, which go into a report. I want to use a command button on click to uncheck the boxes for the next user.
The table is Species the field is click-to-select. Could someone please give me, a nonprogrammer, the code to do this? I tried
[Tables]![species]![click-to-select] = False
but I get an error that says Access can't find the field "I" used in your expression. I'm not sure if "I" is an i or an l; it's a straight line.

Also, I'd like to take a VBA class; but all I'm finding are VBA.NET classes. Is that what I need?

Thank you very much.

SNicholls

 
In the Load event procedure of the form bound to the Species table:
With Me.Recordset
While Not (.EOF Or .BOF)
.Edit
![click-to-select] = False
.Update
.MoveNext
WEnd
.MoveFirst
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

You could try something like this just to clear the fields:

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Me.Check1 = 0
Me.Check2 = 0

Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
 
Thank you both; but I tried each suggested code and nothing happens. There's no error message but the check marks are not removed.

SNicholls

 
A friend suggested an easy answer: use an update query and update click-to-select to no. Then I used a command button on click to run the query.

SNicholls
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top