One button, two commands

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to apply two commands to one button within a form. I have done this
before by assigning a macro that has multiple actions to a button, but I
don't seem to be able to do that this time. I want the button to delete a
record and send a message to an email address. I can add a button to the form
to delete the current record and I can create a macro to send an object
(form, report etc) in an email but macros don't seem to let you delete
individual records. Is there anyway I can perform both actions with just one
button? I hope someone can help. Thanks.
 
Could you create a macro that does both? Then you could assign the macro to
the button when you create it.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Write a Delete query to delete the record. Then run the query and send the
email from your macro.
 
Hi,

Thanks for the help. I've looked into the dete query idea but it looks like
I would then have to apply some kind of criteria to specify which records I
want to delete. I suppose I could get round this by adding a field that I
could activate (like a tick box) before pressing the delete button but I was
hoping that I could delete records as I scrolled through - i.e. pressing the
button would just delete the record I am currently on like it does if you
just apply the delete record command to the button when you set it up through
the button wizard. Is there any way of doing this and still applying the
'send email' macro to the button?
 
No worries - worked it out. There's a delete record option within the run
command action in a query that I wasn't aware of. This should work. Thanks
again.
 
Back
Top