BarryMK
4 strings are enough
- Local time
- Today, 20:09
- Joined
- Oct 15, 2002
- Messages
- 1,350
I have the following piece of code to fire off an email on closing a new record. How can I fit in the link criterion of PK field txtOrderID to the DoCmd.SendObject line so that it will link to the current record? I would normally put '& Me.txtOrderID' in the space now occupied by 'strSubject'. I've tried several variations with " and & etc but so far no joy....
Dim strBody As String, strSubject As String
DoCmd.RunCommand acCmdSaveRecord
strSubject = "You have received a new Purchase request."
strBody = "A purchase request has been added by " & Me!txtRequester & ". Record number " & Me!txtOrderID & ". The supplier is " & Me!txtSupplier & ". The product is " & Me!txtProduct & ". Cost per item is £" & Me!txtCost & ". Product number/code is " & Me!txtCatnumber & ". Quantity is " & Me!txtQuantity & ". Total cost is £" & Me!txtTotalcost & ". Approve by forwarding to finance for action or to sender to reject"
DoCmd.SendObject , , , "access.baffled@isp.com ", , , strSubject, strBody, True
Dim strBody As String, strSubject As String
DoCmd.RunCommand acCmdSaveRecord
strSubject = "You have received a new Purchase request."
strBody = "A purchase request has been added by " & Me!txtRequester & ". Record number " & Me!txtOrderID & ". The supplier is " & Me!txtSupplier & ". The product is " & Me!txtProduct & ". Cost per item is £" & Me!txtCost & ". Product number/code is " & Me!txtCatnumber & ". Quantity is " & Me!txtQuantity & ". Total cost is £" & Me!txtTotalcost & ". Approve by forwarding to finance for action or to sender to reject"
DoCmd.SendObject , , , "access.baffled@isp.com ", , , strSubject, strBody, True