Email a record

E

Enigo

Hi,

I am trying to automate a process within my database. The process being that
when a Super User rejects a transaction it will generate an email to the user
who last modified the record with details of why the transaction has been
rejected.

Here is the code I have been trying to use.

Private Sub Form_AfterUpdate()

If [AR Manager Approval] = "Rejected" Then

DoCmd.SendObject acSendNoObject, _
To:=[LastModifiedBy], _
Subject:="Your transaction request has been rejected", _
MessageText:="Your request to have" & [CustomerName] &
[Invoice Number] & _
" sent to debt refferal has been rejected for the following
reasons - " & _
[Rejected Reason]

End If

End Sub

Can someone please help with this query?
 
E

Erez Mor

hi
it seems like a good idea and the code doesnt seem bad
so what are you asking?
Erez.
 
E

Enigo

Hi,

I am getting the following run time error when the code tries to execute.
Error 2465 - Bad Debt Tracking can't find the field '|' reffered to in your
expression.

I have checked the code and all looks fine. But I am not familiar with vba
in access.

Can you have a look and see if you can spot the error or maybe suggest an
alternative method of doing this.

Thanks again.

Erez Mor said:
hi
it seems like a good idea and the code doesnt seem bad
so what are you asking?
Erez.

Enigo said:
Hi,

I am trying to automate a process within my database. The process being that
when a Super User rejects a transaction it will generate an email to the user
who last modified the record with details of why the transaction has been
rejected.

Here is the code I have been trying to use.

Private Sub Form_AfterUpdate()

If [AR Manager Approval] = "Rejected" Then

DoCmd.SendObject acSendNoObject, _
To:=[LastModifiedBy], _
Subject:="Your transaction request has been rejected", _
MessageText:="Your request to have" & [CustomerName] &
[Invoice Number] & _
" sent to debt refferal has been rejected for the following
reasons - " & _
[Rejected Reason]

End If

End Sub

Can someone please help with this query?
 

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