473,387 Members | 1,693 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,387 software developers and data experts.

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 1471
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.Execute "QueryName", dbFailOnError

--
Wayne Morgan
Microsoft Access MVP
"Jeffro" <je**********@dhs.gov> wrote in message
news:c3**************************@posting.google.c om...
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
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,...
4
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...
6
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...
2
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...
4
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...
6
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...
1
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...
6
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...
13
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.. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.