search recordset and delete

  • Thread starter Thread starter eaytjwr
  • Start date Start date
E

eaytjwr

Guest
Hello anybody

I have a recordset from which I want to delete a variable number of records from: it will be either 3 or 4, where the work order number field is a set value.

How do I search the recordset?

I get the impression from reading posts in here that an sql code would do it: search the recordset for entries where the work order number is, say 232144, then delete them.

I can't use the Access help because I am using German software and I don't understand it so i am pretty helpless...

Any advise much appreciated
eaytjwr
 
Hello

You can do a simple delete query in the query builder.

Go to the query window select create query in design view. Select the table you want to delete the records from. select the Query field on the menu bar. Select delete query. double click on the * in the table then double click on the [work order number] field.
In the criteria row under the [work order number] field enter the number. When you run the query it will delete ALL of the rows containing that number, and the whole row not just the data in [work order number].

Chris
 
very good, thankyou

how do i initiate it from the sub?

:)
 
which sub do you mean?
This code will run a saved query.

Dim stDocName As String

stDocName = "Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Chris
 
Last edited:

Users who are viewing this thread

Back
Top Bottom