Re: deleteing query

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks John,
It's a very good point



"John Spencer" wrote:

As Ofer Cohen said BACK UP YOUR DATA first.

If you should fail to enter a letter you could end up deleting every record
in your database that has a value in the field.

I would at least modify the WHERE clause of the query to

WHERE FieldName LIKE [Please Select a Letter] & IIF(IsNull([Please Select
a Letter]),"","*")

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Ofer Cohen" <OferCohen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F23817C3-2E71-4744-9FAA-D305233DE96E@xxxxxxxxxxxxxxxx
First Back up your MDB, so you can recover the data

You can try a Delete query with Like and wild card (*)

Delete TableName.* From TableName Where FieldName Like [Please select a
letter] & "*"

When the query run the user will be prompt with a message [Please select a
letter], and the query will delete all the records that the a specific
field
start with this letter.


--
Good Luck
BS"D


"h115x" wrote:

how can i delete all records in a table where the description starts with
a
specific letter?



.



Relevant Pages

  • Re: How do I number records in an Access Query?
    ... "John Spencer" wrote: ... L A T E that you need to do a pass-through query. ... "Shawn Bauer" wrote: ... our SMS Host database which is FoxPro it has indexes for all tables. ...
    (microsoft.public.access.queries)
  • Re: Corstabquery or normal query
    ... This is my SQL for Query: ... "John Spencer" wrote: ... IF you have problems with the crosstab query, ... 2007 Deacon Bob 1 ...
    (microsoft.public.access.reports)
  • Re: Corstabquery or normal query
    ... "John Spencer" wrote: ... Try to run the query. ... IF you have problems with the crosstab query, ... 2007 Deacon Bob 1 ...
    (microsoft.public.access.reports)
  • Re: Real 10 random records
    ... "John Spencer" wrote: ... Static bRnd As Boolean ... I have a query which gives me 10 random records. ... It works fine but when I open the database and run the query I always get ...
    (microsoft.public.access.queries)
  • Re: Removing Formatting Symbols from Phone numbers
    ... "John Spencer" wrote: ... Dim strOut As Variant ... For intCount = 1 To Len ... When I attempt to do the Update Query where I copy and past your code into ...
    (microsoft.public.access.queries)