473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Delete Query and Macro

I created a macro to delete the contents of a particular table when
closing Access. How do I turn off the function that gives the warning
messages so it just does it without having to hit OK?

Jun 22 '06 #1
4 3378
On 21 Jun 2006 20:58:39 -0700, "JayDawg" <he******@cox.net> wrote:

Before your code, put another line:
Docmd.Setwarnings False
Since you're on your way out there is no need for
Docmd.Setwarnings True
after your query call, but in my eyes you would still get extra points
for that.

-Tom.

I created a macro to delete the contents of a particular table when
closing Access. How do I turn off the function that gives the warning
messages so it just does it without having to hit OK?


Jun 22 '06 #2
Tom thanks for the response but I am a real novice to this, how do I
get to the VBA code. I set it to run the macro when the switchboard
shuts down.

Tom van Stiphout wrote:
On 21 Jun 2006 20:58:39 -0700, "JayDawg" <he******@cox.net> wrote:

Before your code, put another line:
Docmd.Setwarnings False
Since you're on your way out there is no need for
Docmd.Setwarnings True
after your query call, but in my eyes you would still get extra points
for that.

-Tom.

I created a macro to delete the contents of a particular table when
closing Access. How do I turn off the function that gives the warning
messages so it just does it without having to hit OK?


Jun 22 '06 #3
Never mind I found what I was looking for, you dont evenneed to get
into the code, there is a tab in the options menu called edit/find,
that has a check box for confirmations on action queries and such.

JayDawg wrote:
Tom thanks for the response but I am a real novice to this, how do I
get to the VBA code. I set it to run the macro when the switchboard
shuts down.

Tom van Stiphout wrote:
On 21 Jun 2006 20:58:39 -0700, "JayDawg" <he******@cox.net> wrote:

Before your code, put another line:
Docmd.Setwarnings False
Since you're on your way out there is no need for
Docmd.Setwarnings True
after your query call, but in my eyes you would still get extra points
for that.

-Tom.

I created a macro to delete the contents of a particular table when
closing Access. How do I turn off the function that gives the warning
messages so it just does it without having to hit OK?


Jun 22 '06 #4
"JayDawg" <he******@cox.net> wrote in
news:11**********************@p79g2000cwp.googlegr oups.com:
Never mind I found what I was looking for, you dont evenneed
to get into the code, there is a tab in the options menu
called edit/find, that has a check box for confirmations on
action queries and such.

You'll regret setting those to off the first, second and third
times you accidentally delete several hours of work. I speak
from experience.Better to learn a little bit about code, and
save some grief later.

1) Open your switchboard in design mode.

2) if the properties popup opens at the same time, skip the next
step.

3) Hover over the toolbar icons until you find one labeled
properties and click it to open the properties popup.

4) The popup has several tabs. find the EVENTS tab.
there is an event labled "On Close" It possibly has the name of
your macro beside it.

5) click the down arrowhead at the right. select event
procedure. An elipse (three dots...) will appear to the right.

6) Click on the elipse, the Visual Basic Editor will appear,
with the cursor positioned between two lines of code. The first
should say "Private Sub Form_Close() and the next "End Sub"

7) Add the following between those lines.

Docmd.Setwarnings False
docmd.runSQL "DELETE * from tablename"
Docmd.Setwarnings True

Note: change tablename to the real name of the table.

8) Save and close.

Congratulate yourself.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: foo | last post by:
I'm creating a debug class called debug_mem_allocation for the purpose of finding memory leaks. I used macro's to replace the new and delete operators. My problem is with trying to replace the...
1
by: Greg | last post by:
I run some reports from the web that is connected to an Access database. I run a macro every 25 minutes that deletes the tables and then appends data to the tables with fresh data. The issue I have...
3
by: silver360 | last post by:
Hello, I'm trying to create a basic Heap manager and i have some question about new/delete overloading. The following code give me this output : >> $./heap >> registered : 0x804d098 >>...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
2
by: Birderman | last post by:
Hi, Using MS ACCESS 2003, i have a form for entering data. wih one object on the form (yes/no field) I want to inititiate vba code to run if it changes. I have no problem gettting it to update...
2
by: Scott | last post by:
I have a macro set up to delete a table and then it imports an up-to-date copy of the table. Every once in a while the table gets deleted but the new one isn't imported, I assume the user is...
5
by: MRounds | last post by:
Hi Have looked through many forums but cannot find a solution for this. I have a table where i store certain dates and i want to use this table in several queries to delete records from multiple...
6
by: Annalyzer | last post by:
My database must produces a .csv file with a header line that is different from the detail lines. This .csv file contains a monthly report to an outside agency and is uploaded online so it must...
5
by: agarwasa2008 | last post by:
Hi, I would like to delete a record based on a user entered string. Here are the details. I have a txtFind textbox. A string is entered by the user. Based on that string value it displays that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.