Dialogue box

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

Guest

Thanks in advance for any help i might get

i have a delete record button on a form i would like to change the code so
that when pressed the button would ask me if i would like to send an email to
the perosn concerned and obviously if i say yes the email will go but if i
say no it will go on to delete the record. i have no idea how to do this, i
have the code for the email i need to send i just need a statement for the
dialogue box and how to put it all together

i hope someone can help i appreciate all the help i have had from here in
the past

thanks

Phil
 
Phil,

If you want to send an email OR delete the record, use this:

If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then

'Code to send the email
Else
'Code to delete the record
End If

If you want to optionally send an email, but always delete the record, use
this:

If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then
'Send the email
End If

'Code to delete the record

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Thanks that works great

Phil

Graham R Seach said:
Phil,

If you want to send an email OR delete the record, use this:

If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then

'Code to send the email
Else
'Code to delete the record
End If

If you want to optionally send an email, but always delete the record, use
this:

If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then
'Send the email
End If

'Code to delete the record

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

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