chimp
03-02-2009, 02:56 PM
i think i have this almost to where i want it....
I am trying to set up a sendobject type function, that send info from a table. the table stores id, date etc..
I want he subject line of my email to contain a phrase and the id number held in the table...
table name is
MKT_Lastentry
an the field is called
ID
however i am struggling with one line...
strTitle = "Order Approval required ID Number: " & DlookUp()
i think the issue is the dlookup bit, however not sure how this works.
my code is below.
Option Compare Database
'------------------------------------------------------------
' mcr_emailauto
'
'------------------------------------------------------------
Function mcr_emailauto()
Dim strTitle As String
On Error GoTo mcr_emailauto_Err
strTitle = "Order Approval required ID Number: " & DlookUp()
DoCmd.SendObject acReport, "MKT_Lastentry", "HTML(*.html)", "email@hotmail.com", "moreemails@hotmail.com", "", strTitle, "", False, ""
mcr_emailauto_Exit:
Exit Function
mcr_emailauto_Err:
MsgBox Error$
Resume mcr_emailauto_Exit
End Function
Please help
Andy
I am trying to set up a sendobject type function, that send info from a table. the table stores id, date etc..
I want he subject line of my email to contain a phrase and the id number held in the table...
table name is
MKT_Lastentry
an the field is called
ID
however i am struggling with one line...
strTitle = "Order Approval required ID Number: " & DlookUp()
i think the issue is the dlookup bit, however not sure how this works.
my code is below.
Option Compare Database
'------------------------------------------------------------
' mcr_emailauto
'
'------------------------------------------------------------
Function mcr_emailauto()
Dim strTitle As String
On Error GoTo mcr_emailauto_Err
strTitle = "Order Approval required ID Number: " & DlookUp()
DoCmd.SendObject acReport, "MKT_Lastentry", "HTML(*.html)", "email@hotmail.com", "moreemails@hotmail.com", "", strTitle, "", False, ""
mcr_emailauto_Exit:
Exit Function
mcr_emailauto_Err:
MsgBox Error$
Resume mcr_emailauto_Exit
End Function
Please help
Andy