Clear a table on button click.

Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Nov 2008
Posts: 459
Reputation: Grn Xtrm will become famous soon enough Grn Xtrm will become famous soon enough 
Solved Threads: 37
Grn Xtrm's Avatar
Grn Xtrm Grn Xtrm is offline Offline
Posting Pro in Training

Clear a table on button click.

 
0
  #1
May 4th, 2009
Hello friends, I want to clear a table by clicking a button on a form. I have created the query to clear the table but I cannot make it the source for the command button on the form. Is this possible? Thanks for your time and help.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 195
Reputation: HI2Japan is an unknown quantity at this point 
Solved Threads: 21
HI2Japan HI2Japan is offline Offline
Junior Poster

Re: Clear a table on button click.

 
1
  #2
May 4th, 2009
I'm sure there is a VBA approach to this, but you could also make a macro with 6 lines in it.

Make a new Macro and use the following:

SetWarnings = No
OpenTable = table you want to remove all records from
RunCommand = SelectAllRecords
RunCommand = DeleteRecord
Close = choose table and specify table you just opened
SetWarnings = Yes


After the macro is made, make a command button and assign the macro to it.

No need to use a query to do this.

Good luck
Last edited by HI2Japan; May 4th, 2009 at 7:20 pm. Reason: added more info.
Who was the first person to look at a cow and say, "I think I'll squeeze these dangly things here, and drink whatever comes out!"
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 459
Reputation: Grn Xtrm will become famous soon enough Grn Xtrm will become famous soon enough 
Solved Threads: 37
Grn Xtrm's Avatar
Grn Xtrm Grn Xtrm is offline Offline
Posting Pro in Training

Re: Clear a table on button click.

 
0
  #3
May 5th, 2009
Many thanks, it worked just as I wanted it to!
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC