Find and Replace

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Form 'Delete' displaying records (Debits and Credits).
All the transactions (approx 10 at a time) have a 'Yes/No' field named
'Active', with the current records set to 'Yes".
I want to delete all the displayed records by changing 'Yes' to 'No' in the
Active field.
I can do it easily with the Find and Replace commands in the Edit menu - but
I want to write code to a Command Button, so that other Users can simply
click on the button to effect the change to all the displayed records.
Can anybody give me the syntax, or line of code to do this?
Appreciate any help
 
Glynn,

This would be a job for an Update Query. You can do it in code on the
Click event of your command button like this...
CurrentDb.Execute "UPDATE YourTable SET Active = 0 WHERE Active <> 0"
 
Back
Top