lifeson
New Member
- Location
- Here or There but mainly Here
Way off topic but someone may be able to help
Need abit of excel help if we have any gurus out there
I am using vba in excel to get data from an Acccess database.
I can get it to run querrys on one table but when I join two related tables together I get an error
This is the code:
src = "SELECT TblDiscountsApplied.LeadNumber, " & _
"TblDiscountsApplied.QuoteID, " & _
"TblDiscountsApplied.ResourceType, " & _
"TblDiscountsApplied.DiscountCodeID, " & _
"TblDiscount.DiscountDescription, " & _
"TblDiscountsApplied.Value " & _
"FROM TblDiscountsApplied " & _
"INNER JOIN TblDiscount " & _
"ON TblDiscountsApplied.DiscountCodeID = TblDiscount.DiscountCodeID" & _
"WHERE (((TblDiscountsApplied.LeadNumber) = 30520827) And ((TblDiscountsApplied.quoteID) = 'A'))" & _
"WITH OWNERACCESS OPTION;"
The error message says join method not suppoted.
Anybody know where I have gone wrong (statring the project is where I really went wrong ) or the correct syntax for joining two tables in a VBA querry?
Need abit of excel help if we have any gurus out there
I am using vba in excel to get data from an Acccess database.
I can get it to run querrys on one table but when I join two related tables together I get an error
This is the code:
src = "SELECT TblDiscountsApplied.LeadNumber, " & _
"TblDiscountsApplied.QuoteID, " & _
"TblDiscountsApplied.ResourceType, " & _
"TblDiscountsApplied.DiscountCodeID, " & _
"TblDiscount.DiscountDescription, " & _
"TblDiscountsApplied.Value " & _
"FROM TblDiscountsApplied " & _
"INNER JOIN TblDiscount " & _
"ON TblDiscountsApplied.DiscountCodeID = TblDiscount.DiscountCodeID" & _
"WHERE (((TblDiscountsApplied.LeadNumber) = 30520827) And ((TblDiscountsApplied.quoteID) = 'A'))" & _
"WITH OWNERACCESS OPTION;"
The error message says join method not suppoted.
Anybody know where I have gone wrong (statring the project is where I really went wrong ) or the correct syntax for joining two tables in a VBA querry?