Hi
The following code is giving me the runtime error 13 Type Mismatch On the set rs line. Again, I am very new to VBA and would appreciate any pointers on this error. I am simply trying to self teach myself and thought running a query and emailing it would be an OK place to start. I know that a mismatch usually has to do with field with different data types but in this case I am puzzled. Thanks for taking anytime to help me!
Christine
Option Compare Database
Option Explicit
Private Sub Command0_Click()
DoCmd.SetWarnings False
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("Select * from INVUPC;"
If rs!Supplier = 8303 Then
DoCmd.OpenQuery ("QUERYVENDOR8303", acNormal, acEdit
DoCmd.SendObject acTable, "Publisher Data", "MicrosoftExcel(*.xls)", "cbotham@indigo.ca", "", "", "", "", False, ""
End If
Set rs = Nothing
DoCmd.SetWarnings True
End Sub
The following code is giving me the runtime error 13 Type Mismatch On the set rs line. Again, I am very new to VBA and would appreciate any pointers on this error. I am simply trying to self teach myself and thought running a query and emailing it would be an OK place to start. I know that a mismatch usually has to do with field with different data types but in this case I am puzzled. Thanks for taking anytime to help me!
Christine
Option Compare Database
Option Explicit
Private Sub Command0_Click()
DoCmd.SetWarnings False
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("Select * from INVUPC;"
If rs!Supplier = 8303 Then
DoCmd.OpenQuery ("QUERYVENDOR8303", acNormal, acEdit
DoCmd.SendObject acTable, "Publisher Data", "MicrosoftExcel(*.xls)", "cbotham@indigo.ca", "", "", "", "", False, ""
End If
Set rs = Nothing
DoCmd.SetWarnings True
End Sub