DoCmd to delete records

D

davea

Hi

I have a command button that when clicked deletes certain records from
a subform based on an application number being equal. It deletes all
records with the same applciation number as currently shown on the
main form, see code below:

DoCmd.RunSQL ("DELETE FROM tblAdultDetails WHERE
[frmAdultDetails2].Form![ApplicationNum]=" +
Str(Me.ApplicationNumber))

However I would like it to only delete records if the fields
[MainApplicantFlag] =1 or [PartnerFlag] =1 as well as ApplicationNum
being equal. These are both number fields btw.

Can someone tell me what I should add to my code in order to do this?
I'm not sure of the syntax.

Thanks
 

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