G
Guest
In pasting SQL into a line of code in a form's VBA code, I have reached a
point where it will no longer accept any more characters. It is lengthy, and
as best I know the SQL statement has to be all on one line. Is there a way
around this? I tried hitting "Enter" and then continuing on the following
line, but that started resulting in errors. Is each line limited to quantity
of characters or quantity of objects? With all of Access's capabilities, it
doesn't seem there should be a limit like this.
I've pasted the SQL statement below in case there is a way to alter it to
fit it on the line. Any feed back is greatly appreciated!
strSQL = "SELECT Project.ProjectName, Bid.BidNumber, Item.RoomNumber & "" -
"" & Item.ItemNumber AS ItemLabel, Item.RoomNumber, Item.ItemNumber,
Product.LibraryReference, Item.RoomName, Item.ElevationReference,
Item.ProductSummary, ItemDetail.Quantity, ItemDetail.ProductDescription,
Product.UnitCost, ItemDetail.QuoteCost, Product.UOM,
[Quantity]*([UnitCost]+[QuoteCost]) AS LineTotalCost, ItemDetail.Markup,
[LineTotalCost]*[Markup] AS SellPrice, Project.SalesTax, Bid.[Engineering%],
Bid.SalesTaxAmount, Bid.BidDate, Bid.Estimator, Project.GCName,
ItemDetail.ItemDetailNotes, Bid.SalesTaxAmount, Project.GCContact,
Bid.PriceIncludes, Bid.PriceDoesNotInclude, Customer.GCStreetAddress,
[GCCity] & "" , "" & [GCState] & "" "" & [GCZip] AS CityState,
Bid.ScopeNotes, Bid.BidType, Project.SiteStreetAddress, [SiteCity] & "" , ""
& [SiteState] & "" "" & [SiteZip] AS SiteCityState, Product.CBDCode,
[Quantity]*[MaterialCost] AS LineMaterialCost,
[Quantity]*([MachineLaborHours]+[BuildingLaborHours]) AS LineTotalLabor" & _
point where it will no longer accept any more characters. It is lengthy, and
as best I know the SQL statement has to be all on one line. Is there a way
around this? I tried hitting "Enter" and then continuing on the following
line, but that started resulting in errors. Is each line limited to quantity
of characters or quantity of objects? With all of Access's capabilities, it
doesn't seem there should be a limit like this.
I've pasted the SQL statement below in case there is a way to alter it to
fit it on the line. Any feed back is greatly appreciated!
strSQL = "SELECT Project.ProjectName, Bid.BidNumber, Item.RoomNumber & "" -
"" & Item.ItemNumber AS ItemLabel, Item.RoomNumber, Item.ItemNumber,
Product.LibraryReference, Item.RoomName, Item.ElevationReference,
Item.ProductSummary, ItemDetail.Quantity, ItemDetail.ProductDescription,
Product.UnitCost, ItemDetail.QuoteCost, Product.UOM,
[Quantity]*([UnitCost]+[QuoteCost]) AS LineTotalCost, ItemDetail.Markup,
[LineTotalCost]*[Markup] AS SellPrice, Project.SalesTax, Bid.[Engineering%],
Bid.SalesTaxAmount, Bid.BidDate, Bid.Estimator, Project.GCName,
ItemDetail.ItemDetailNotes, Bid.SalesTaxAmount, Project.GCContact,
Bid.PriceIncludes, Bid.PriceDoesNotInclude, Customer.GCStreetAddress,
[GCCity] & "" , "" & [GCState] & "" "" & [GCZip] AS CityState,
Bid.ScopeNotes, Bid.BidType, Project.SiteStreetAddress, [SiteCity] & "" , ""
& [SiteState] & "" "" & [SiteZip] AS SiteCityState, Product.CBDCode,
[Quantity]*[MaterialCost] AS LineMaterialCost,
[Quantity]*([MachineLaborHours]+[BuildingLaborHours]) AS LineTotalLabor" & _