Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi The following code is giving

Status
Not open for further replies.

KrissyB

Technical User
May 2, 2003
27
CA
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
 
A possability depends on the ver of Ms. A. involved. "Her" olsder personality would recognize the rs as being of the "DAO." type, while the younger cousins would be confused as they haven'y quite learned how to distinguish "DAO." from "ADO." so would need you to prompt them for the latter and reference them to the former.


(p.s. all is revealed in HELP)




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Thanks Michael, never even occurred to me! ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top