Amending check box values

J

Jedster

I have a list of products on a form with "To send" and "Sent" check boxes
beside them. At the top of the form, I have a button that runs an update
query to move all records marked as "To send" to "Sent" (ie. where the "To
send" value is True, amend this to False and change the corresponding "Sent"
field to True).

The query works fine for all records except the one currently selected.
What is the correct code I need to use to save all changes to the records and
unlock them so that the query will run successfully, assuming this will be
all I need to do?

Regards,

Jedster
 
A

Allen Browne

Save any changes to the current record before executing your UPDATE query,
e.g.:

strSQL = "UPDATE ...
If Me.Dirty Then
Me.Dirty = False
End If
dbEngine(0)(0).Execute strSQL, dbFailOnError
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top