Paradise Lost: Help setting up a delete query

  • Thread starter Thread starter moneyball.wilson
  • Start date Start date
M

moneyball.wilson

Hi,

I am trying to set up a delete query so that I can delete progress
reports. The progress report contains a main form and a subform. I am
trying to set up the query so that when I click on a button whatever
report is currently showing on the form is deleted and all the data for
that particular day is cleared, but I am having some trouble doing
that. In other words I am looking for a way to set up the query so
that it selects the record refering to the particualr date displayed on
the form and then deletes it. Can anyone help? Does this make any
sense?

Sincerely,
Rambo
 
Hi,


DoCmd.RunSQL "DELETE FROM tableName WHERE dateField =
FORMS!formNameHere!ControlNameHere"


should do the job. Make sure you test on a dummy database, to not delete
useful records.


Hoping it may help,
Vanderghast, Access MVP
 

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

Back
Top