Acquire and download Microsoft Office from $ 59!
Microsoft Workplace Sp3 Sale: I am writing an application using VBA. I am utilizing Microsoft Windows XP Specialist Edition (SP3) and Microsoft Office Excel (SP3). There is a thing wrong with my SQL statement:
.CommandText = Array(“Select DISTINCT Transactions.TRANID, Classes.Full_Title, Entity.Complete_Title, Transactions.TRANSACTION_Form FROM Classes INNER JOIN (Transaction_Lines INNER JOIN (Transactions INNER JOIN Entity ON Entity.ENTITY_ID = Transactions.ENTITY_ID) ON Transaction_Lines.TRANSACTION_ID = Transactions.TRANSACTION_ID) ON Transaction_Lines.CLASS_ID = Classes.CLASS_ID Where Transactions.TRANSACTION_Kind = ‘Sales Order’ AND Entity.ENTITY_ID = Transactions.ENTITY_ID AND (Transactions.Status = ‘Pending Fulfillment’ OR Transactions.Status = ‘Pending Billing/Partially Fulfilled’ OR Transactions.Standing = ‘Partially Fulfilled’)”)
It’s within a With Block:
With ActiveSheet.QueryTables.Add(Connection:=”ODBCDSN=NetSuite.comUID=myUserID.comPWD=myPassword”, Location:=Array(“A1″))
.CommandText = Array(“Choose DISTINCT Transactions.TRANID, Courses.Full_Title, Entity.Full_Title, Transactions.TRANSACTION_Form FROM Courses INNER JOIN (Transaction_Lines INNER JOIN (Transactions INNER JOIN Entity ON Entity.ENTITY_ID = Transactions.ENTITY_ID) ON Transaction_Lines.TRANSACTION_ID = Transactions.TRANSACTION_ID) ON Transaction_Lines.CLASS_ID = Classes.CLASS_ID Where Transactions.TRANSACTION_Form = ‘Sales Order’ AND Entity.ENTITY_ID = Transactions.ENTITY_ID AND (Transactions.Standing = ‘Pending Fulfillment’ OR Transactions.Status = ‘Pending Billing/Partially Fulfilled’ OR Transactions.Status = ‘Partially Fulfilled’)”)
.Name = “myCompany_ TRANSACTIONS”
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = Correct
.RefreshOnFileOpen = False
.BackgroundQuery = Accurate
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = Correct
.AdjustColumnWidth = Genuine
.RefreshPeriod =
.PreserveColumnInfo = True
.SourceConnectionFile = “C:Documents and SettingsmyFolderMy DocumentsMy Data SourcesmyCompany_ TRANSACTIONS.odc”
.Refresh BackgroundQuery:=False
Finish With
At the line with the SQL statement, I receive the following error:
Run-time error ’13′ Form Mismatch
Any assist would be most appreciated.
I figured it out. You just delete Array() from:
.CommandText = Array(“Decide on DISTINCT Transactions.TRANID, Courses.Complete_Title, Entity.Full_Name, Transactions.TRANSACTION_Kind FROM Courses INNER JOIN (Transaction_Lines INNER JOIN (Transactions INNER JOIN Entity ON Entity.ENTITY_ID = Transactions.ENTITY_ID) ON Transaction_Lines.TRANSACTION_ID = Transactions.TRANSACTION_ID) ON Transaction_Lines.CLASS_ID = Classes.CLASS_ID In which Transactions.TRANSACTION_Sort = ‘Sales Order’ AND Entity.ENTITY_ID = Transactions.ENTITY_ID AND (Transactions.Standing = ‘Pending Fulfillment’ OR Transactions.Standing = ‘Pending Billing/Partially Fulfilled’ OR Transactions.Status = ‘Partially Fulfilled’)”)
I do not know why this brought on the dilemma, but, without having it, it functions just fine.
Answer by Serge M
Check data sort of the TRANSACTION_Kind and Standing columns.
Purchase and download Microsoft Office from $ 59!
