Erase data when close form

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

Guest

Hi!

I have a form, based in T_Rub
The form has check boxes only to choose Y/N.
Based in these check boxes I have a conditional query.
When click in check boxes, write a mark in T_Rub.
The next time the T_Rub has these marks.
Is possible to erase these marks in field Y/N in T_Tub when close the form,
please?

Thanks in advance.
an
 
You can use the Form_Unload or Form_Close Event to run an UPDATE Query / SQL
that updates the CheckBoxField value to False (0).
 
VTD,

Thank youy for your solution. Work fine.

In adition:
How is possible don't show two menus
"You are about to run..." and
"You are about to update 'n' rows?"

Thanks more one time.
an
 
Are you using the DoCmd.OpenQuery / RunSQL method to do the update?

If that's the case, use

DoCmd.SetWarnings False
DoCmd.OpenQuery (or RunSQL)
DoCmd.SetWarnings True

You may want to change the code to use the Execute method of the Database
object (DAO) or the Connection object (ADO) which does not give any warning.

Check Access VB Help on the Execute method.
 
Yes I do.
I used DoCmd.OpenQuery.

Now, with your solution worked very fine.
More one time, thank you very much.

Have you a good weekend.
an
 

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

Back
Top