From: susan on
Hi,

i have a connection to an access-database which works fine. Now I want to
delete all records of a table by clicking a commandbutton. I know I have to
use a loop, but I don't get it working...

Private Sub Command1_Clcik()
Adodc1.RecordSource = "TREX"
' delete all records of this table
' fieldnames are "ID", "Name" and "Title"

End Sub

Thanks,

susan


From: jake on
Susan:

This will work but I believe there is a way to delete all records
with 1 command, I just can't remember it:

Do while RS.EOF = False
RS.Delete
RS.MoveNext
Loop

Don't worry about the field names, doesn't matter.

Jake





On Jul 3, 7:01 am, "susan" <v...(a)hotmail.com> wrote:
> Hi,
>
> i have a connection to an access-database which works fine. Now I want to
> delete all records of a table by clicking a commandbutton. I know I have to
> use a loop, but I don't get it working...
>
> Private Sub Command1_Clcik()
> Adodc1.RecordSource = "TREX"
> ' delete all records of this table
> ' fieldnames are "ID", "Name" and "Title"
>
> End Sub
>
> Thanks,
>
> susan