Thank you John.
What does the "CurrentDb.Execute" phrase do that makes the statement work?
Bill
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Saturday, December 17, 2016 4:00 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Delete Records
Bill-
When you want to run an "action" query in code, you need to execute it.
CurrentDb.Execute "DELETE * FROM GameShedule", dbFailOnError
or
CurrentDb.Execute "DELETE * FROM GameSchedule WHERE fscEveID = 2", dbFailOnError
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Dec 17, 2016, at 8:03 PM, 'Bill Singer' Bill.Singer@at-group.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I am trying to create a button that will easily delete all records from a temporary table.
I have created a delete query but I want to run it from a button. I can't get the button to see the delete query so I though about some SQL.
I have tried.
DELETE FROM GameSchedule;
DELETE * FROM GameSchedule;
What am I doing wrong? I keep getting an error message "Expected End of Statement" with the word "GameSchedule" highlighted.
Eventually I want another button that will reduce specific records.
DELETE * FROM GameSchedule;
WHERE fscEveID = 2
Thank you,
Bill Singer
MN,
Heading to 25 below tonight.
Posted by: "Bill Singer" <Bill.Singer@at-group.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
Tidak ada komentar:
Posting Komentar