If someone could explain what I am doing wrong with the result set in this code to create the type mismatch error on the first line I would be extremely grateful.
Chris
Sub Proc_MacroModuleQueryTest_DONT_USE()
On Error GoTo Proc_MacroModuleQueryTest_DONT_USE_Err
Dim RS As New ADODB.Recordset
Set RS = CurrentDb.OpenRecordset("SELECT Supplier FROM INVUPC;"
' This Query Clears the Table POATEST, so that we can obtain data from POA reports specific to DBQ
DoCmd.OpenQuery "QUERY_CLEARPOATEST", acNormal, acEdit
' This Query Appends data specific to DBQ from the table CHP_LOAD_POA_STATUS to POATEST table
DoCmd.OpenQuery "QUERY_APPENDCHP_LOAD_POA_STATUS", acNormal, acEdit
' This Query Appends data specific to DBQ from the table CHP_POA_STATUS to POATEST table
DoCmd.OpenQuery "QUERY_APPENDCHP_POA_STATUS", acNormal, acEdit
' Opens Query INVUPC
DoCmd.OpenQuery "QUERY_INVALTUPC", acNormal, acEdit
' Ok, these are all the queries I run to create the tables, but now I want to specify different email
' address based on the data for each publisher. For example, in hte test data there are 5 UPC's 1 goes
' to Supplier 8303, with email cbotham@indigo.com
If RS!Supplier = "8303" Then
DoCmd.OpenQuery "copyappending", acNormal, acEdit
DoCmd.SendObject acTable, "Publisher Data", "MicrosoftExcel(*.xls)", "cbotham@indigo.ca", "", "", "", "", False, ""
End If
'Will this send only the data from Publisher Data with Supplier 8303, or the whole file?
Proc_MacroModuleQueryTest_DONT_USE_Exit:
Exit Sub
Proc_MacroModuleQueryTest_DONT_USE_Err:
MsgBox Error$
Resume Proc_MacroModuleQueryTest_DONT_USE_Exit
End Sub
Chris
Sub Proc_MacroModuleQueryTest_DONT_USE()
On Error GoTo Proc_MacroModuleQueryTest_DONT_USE_Err
Dim RS As New ADODB.Recordset
Set RS = CurrentDb.OpenRecordset("SELECT Supplier FROM INVUPC;"
' This Query Clears the Table POATEST, so that we can obtain data from POA reports specific to DBQ
DoCmd.OpenQuery "QUERY_CLEARPOATEST", acNormal, acEdit
' This Query Appends data specific to DBQ from the table CHP_LOAD_POA_STATUS to POATEST table
DoCmd.OpenQuery "QUERY_APPENDCHP_LOAD_POA_STATUS", acNormal, acEdit
' This Query Appends data specific to DBQ from the table CHP_POA_STATUS to POATEST table
DoCmd.OpenQuery "QUERY_APPENDCHP_POA_STATUS", acNormal, acEdit
' Opens Query INVUPC
DoCmd.OpenQuery "QUERY_INVALTUPC", acNormal, acEdit
' Ok, these are all the queries I run to create the tables, but now I want to specify different email
' address based on the data for each publisher. For example, in hte test data there are 5 UPC's 1 goes
' to Supplier 8303, with email cbotham@indigo.com
If RS!Supplier = "8303" Then
DoCmd.OpenQuery "copyappending", acNormal, acEdit
DoCmd.SendObject acTable, "Publisher Data", "MicrosoftExcel(*.xls)", "cbotham@indigo.ca", "", "", "", "", False, ""
End If
'Will this send only the data from Publisher Data with Supplier 8303, or the whole file?
Proc_MacroModuleQueryTest_DONT_USE_Exit:
Exit Sub
Proc_MacroModuleQueryTest_DONT_USE_Err:
MsgBox Error$
Resume Proc_MacroModuleQueryTest_DONT_USE_Exit
End Sub