473,761 Members | 8,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple code to delete all rcd in a table and import records to same table

Hi,
I am trying to create a form that would have only two buttons on it.
When the user clicks on one of the buttons it will issue a prompt such
as

Do you wish to delete all records from the Classes Table?
YES NO

Upon clicking on yes, then all the records in the classes table would
be deleted.
The second button when click would ask:

Do you wish to import records to the classes table. If the user
clicks the yes button then records are imported from a ascii(Text
file, with field delimiters) into the classes table.

Know this should be simple, but I seemed to be making it harder than
it should.
Any suggestion on logic to use?

Thanks,

Jeff
Nov 12 '05 #1
1 1487
Create yourself a delete query and an append query that does what you want.
When you have that working, call them using the command buttons. The syntax
to run them is

CurrentDb.Execu te "QueryName" , dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"Jeffro" <je**********@d hs.gov> wrote in message
news:c3******** *************** ***@posting.goo gle.com...
Hi,
I am trying to create a form that would have only two buttons on it.
When the user clicks on one of the buttons it will issue a prompt such
as

Do you wish to delete all records from the Classes Table?
YES NO

Upon clicking on yes, then all the records in the classes table would
be deleted.
The second button when click would ask:

Do you wish to import records to the classes table. If the user
clicks the yes button then records are imported from a ascii(Text
file, with field delimiters) into the classes table.

Know this should be simple, but I seemed to be making it harder than
it should.
Any suggestion on logic to use?

Thanks,

Jeff

Nov 12 '05 #2

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

Similar topics

6
1685
by: Rudi Ahlers | last post by:
A different question though. Is it possible to delete duplicate entries, where the email address is the same, and only keep one? i.e.. I got say 4 DB entries, all with the same email address, and I want to delete 3. How do I do this? -- Kind Regards
4
1990
by: Belinda | last post by:
Hello All I need to read a SQL Server table into a Web Page and within the Web Page to permit my users to make changes to the records, delete or add new records and then save the entire contents back to the SQL Server table back. The functionality I am looking is almost the same as In the SQL Enterprise Manager whereby I can choose a table open the table and then return all rows and I can maintain the same and save it back to
6
5556
by: xixi | last post by:
hi, i read from some of the post that if i want to delete a whole table using sql, i can use empty option to delete all the records but keep the table definition, how to do that? the reason i want this because i will get log full error for delete many records before commit. instead of increase the log file size, i would like to know other option like it mentioned above.
2
4991
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3 fields (vehicleID, BattID, and ChgHrs). VehicleID and BattID are a TEXT datatype and ChrHrs are a number(long int.) datatype. Since records to be imported can have duplicate records of the composite key I need to clean all but one of the...
4
6163
by: KT | last post by:
Is there any one click solution that would do the trick? I would like to create a button, so the person who maintains the database can perform clean up work to delete duplicate records which contain same information in the ID field and the account number field once a week. Thanks in advance! KT
6
9650
by: deko | last post by:
Now that users are handy at importing tables from an Excel spreadsheet, I've discovered a very dangerous problem. If the user decides to name the imported table the same name as an existing table in the database, the Spreadsheet Import Wizard will happily overwrite the table - and bye-bye database. Is there a way to prevent this with code? Must I now read the Access Security FAQ?
1
3625
by: Matt | last post by:
I am writing a DELETE statement and I want to filter the records using another SELECT statement. My SELECT statement is a GROUP BY query that grabs all social security numbers from the "Data With Import Date Current" table on a given day where there was only one transaction (count of SSN = 1). I want to delete these records from the "Data With Import Date Current" table. I would like to do this by joining the "Data With Import Date...
6
11290
by: satish mullapudi | last post by:
Hi All, I am getting strange situation. These r the steps I have followed: 1. Created an EMPLOYEE table with around 14 fields & 688038 records. (so a large table indeed). 2. Tried to delete all the rows in the table using the traditional DELETE FROM EMPLOYEE stmt. It is taking around 53 secs to delete all the records. So I have done the below steps to make it fatster: (i) Create an empty file called No_Data.DEL in the C:\ drive....
13
26929
by: ramprakashjava | last post by:
hi, i hav "java.lang.NullPointerException" error while Deleting table records using checkbox in jsp here i enclosed files help quickly plzzz.. Regards Ramprakash /*Adminpage.jsp*/ <%@ page language="java" import="java.sql.*"%> <html> <head>...
0
9376
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9923
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.