Access 2003 to 2010 conversion issue...Object variable or with block variable not set
Posted on 2013-06-14
I have an Access db created in Access 2003 that needs to be converted to 2010. In general the db functions in 2010, but the database was able to send out an email with the click of a button in 2003. Now when I click the botton I get an error..."object variable or With block variable not set". This button runs off the below code. Any suggestions of what I need to do to make this functional in 2010? I would really appreciate it!
Option Compare Database
Private Sub Command5_Click()
Dim stDocName As String
Dim stLinkCriteria As String
On Error GoTo Err_Command5_Click
strsql = "select Title, Name, Email_Address into [tblLocalEmailFlow] from tblEmailFlow where [frm1-Step1] = 1;"
stDocName = "frmSendEmail"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria