clear a table after clicking the command button

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

Guest

I have a button that let me submit a table when clicked. Now, how do I clear
the same table after that? I ran out of ideas, so I need your help please
Thank you
 
If you want to delete all the records in Table1:

dbEngine(0)(0).Execute "DELETE FROM [Table1];", dbFailOnError
 
Thank you Allen for your help. This is what I needed.
I have one more question though. This made me realize that I was not
including the current record on my email. How do I add the record first to
the table before submitting it?

Allen Browne said:
If you want to delete all the records in Table1:

dbEngine(0)(0).Execute "DELETE FROM [Table1];", dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

fifi said:
I have a button that let me submit a table when clicked. Now, how do I
clear
the same table after that? I ran out of ideas, so I need your help please
Thank you
 
If you have a form bound to a table, and you want to force the save of the
record currently being edited, the safest code is:
Me.Dirty = False

If the form has focus, you could use:
RunCommand acCmdSaveRecord

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

fifi said:
Thank you Allen for your help. This is what I needed.
I have one more question though. This made me realize that I was not
including the current record on my email. How do I add the record first
to
the table before submitting it?

Allen Browne said:
If you want to delete all the records in Table1:

dbEngine(0)(0).Execute "DELETE FROM [Table1];", dbFailOnError


fifi said:
I have a button that let me submit a table when clicked. Now, how do I
clear
the same table after that? I ran out of ideas, so I need your help
please
Thank you
 
rock on.
It works now. Thank you

Allen Browne said:
If you have a form bound to a table, and you want to force the save of the
record currently being edited, the safest code is:
Me.Dirty = False

If the form has focus, you could use:
RunCommand acCmdSaveRecord

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

fifi said:
Thank you Allen for your help. This is what I needed.
I have one more question though. This made me realize that I was not
including the current record on my email. How do I add the record first
to
the table before submitting it?

Allen Browne said:
If you want to delete all the records in Table1:

dbEngine(0)(0).Execute "DELETE FROM [Table1];", dbFailOnError


I have a button that let me submit a table when clicked. Now, how do I
clear
the same table after that? I ran out of ideas, so I need your help
please
Thank you
 

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