Coding for a delete query when applying a filter

G

Graeme

I want some code that will delete data from a table after a filter has been
applied.

The filter would need to pick up the first two characters of a text string
field.

I'd then want to delete any record that contained that matched the filter.

Can anyone help?
 
O

Ofer Cohen

I Could have gave you a better example of I knew exactly what the filter you
are using
Use the RunSQL to run a delete query and apply the filter

Docmd.SetWarnings False
Docmd.RunSQL "DELETE * FROM TableName WHERE FieldName= '" &
[SomeStringValue] & "'"
Docmd.SetWarnings True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top