Link to home
Start Free TrialLog in
Avatar of bill201
bill201

asked on

a problem with dim a variable in access vba 2010

i try to copy this code to a  field but when i run this code i get in the field only the word "false"

 why is this do is a limit in the length from a string
Dim SqlPart1 As String
Dim SqlPart2 As String
Dim SqlStatement2 As String
Dim Where As String

SqlPart1 = " SELECT InvoicesDetailsAndInvoicesZikuiDetailsListQ.Product, Sum(InvoicesDetailsAndInvoicesZikuiDetailsListQ.Qty) AS SumOfQty, " & _
                " InvoicesDetailsAndInvoicesZikuiDetailsListQ.Price, InvoicesDetailsAndInvoicesZikuiDetailsListQ.commission, " & _
                " Sum([qty]*[price]) AS Total, IIf([invoicet.maam]<>0,True,False) AS TaxCheckBox, InvoiceT.Customer, " & _
                " InvoicesDetailsAndInvoicesZikuiDetailsListQ.maam " & _
                " FROM InvoicesDetailsAndInvoicesZikuiDetailsListQ INNER JOIN InvoiceT ON InvoicesDetailsAndInvoicesZikuiDetailsListQ.InvoiceID = InvoiceT.InvoiceID " & _
SqlPart2 = " GROUP BY InvoicesDetailsAndInvoicesZikuiDetailsListQ.Product, InvoicesDetailsAndInvoicesZikuiDetailsListQ.Price, " & _
                " InvoicesDetailsAndInvoicesZikuiDetailsListQ.commission, " & _
                " IIf([invoicet.maam]<>0,True,False), InvoiceT.Customer, InvoicesDetailsAndInvoicesZikuiDetailsListQ.maam "
 SqlStatement2 = " SELECT InvoiceID, Product, Qty as sumofqty, Price, total, commission, Customer, OrderDate " & _
                " FROM InvoicesDetailsAndInvoicesZikuiDetailsListQ "
Text0 = SqlPart1 & SqlPart2
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial