Hi,
I have built in code a long sql statement as follows:
SELECT Age, BirdType, Flock, House, [Lab#], Organ, Origin, SampleDate, SampleType, Site, Source, SourceGroup, [VT#], ProfileID, APIName1, APIAmts1, APILevels1, FullVals1, Match1, APIName2, APIAmts2, APILevels2, FullVals2, Match2, APIName3, APIAmts3, APILevels3, FullVals3, Match3, APIName4, APIAmts4, APILevels4, FullVals4, Match4, APIName5, APIAmts5, APILevels5, FullVals5, Match5, APIName6, APIAmts6, APILevels6, FullVals6, Match6, APIName7, APIAmts7, APILevels7, FullVals7, Match7, APIName8, APIAmts8, APILevels8, FullVals8, Match8, APIName9, APIAmts9, APILevels9, FullVals9, Match9 , APIName10, APIAmts10, APILevels10, FullVals10, Match10, APIName11, APIAmts11, APILevels11, FullVals11, Match11, APIName12, APIAmts12, APILevels12, FullVals12, Match12, APIName13, APIAmts13, APILevels13, FullVals13, Match13, APIName14, APIAmts14, APILevels14, FullVals14, Match14, APIName15, APIAmts15, APILevels15, FullVals15, Match15, APIName17, APIAmts17, APILevels17, FullVals17, Match17, APIName18, APIAmts18, APILevels18, FullVals
18, Match18, APIName19, APIAmts19, APILevels19, FullVals19, Match19 , APIName20, APIAmts20, APILevels20, FullVals20, Match20, APIName21, APIAmts21, APILevels21, FullVals21, Match21, APIName22, APIAmts22, APILevels22, FullVals22, Match22, APIName23, APIAmts23, APILevels23, FullVals23, Match23, APIName24, APIAmts24, APILevels24, FullVals24, Match24, APIName25, APIAmts25, APILevels25, FullVals25, Match25 FROM qryReportBaseLevel2 ORDER BY qryReportBaseLevel2.SourceGroup, qryReportBaseLevel2.Source, qryReportBaseLevel2.ProfileID;
When I try to open a recordset based on this sql, it gives me the runtime error - which is odd since I don't have any criteria in the statement.
I think the problem may be that vba is somehow adding a line break between "fullvals" and "18", but I don't know why it would do so and it doesn't always (only if the string is long). Can anyone help?
Thanks!
I have built in code a long sql statement as follows:
SELECT Age, BirdType, Flock, House, [Lab#], Organ, Origin, SampleDate, SampleType, Site, Source, SourceGroup, [VT#], ProfileID, APIName1, APIAmts1, APILevels1, FullVals1, Match1, APIName2, APIAmts2, APILevels2, FullVals2, Match2, APIName3, APIAmts3, APILevels3, FullVals3, Match3, APIName4, APIAmts4, APILevels4, FullVals4, Match4, APIName5, APIAmts5, APILevels5, FullVals5, Match5, APIName6, APIAmts6, APILevels6, FullVals6, Match6, APIName7, APIAmts7, APILevels7, FullVals7, Match7, APIName8, APIAmts8, APILevels8, FullVals8, Match8, APIName9, APIAmts9, APILevels9, FullVals9, Match9 , APIName10, APIAmts10, APILevels10, FullVals10, Match10, APIName11, APIAmts11, APILevels11, FullVals11, Match11, APIName12, APIAmts12, APILevels12, FullVals12, Match12, APIName13, APIAmts13, APILevels13, FullVals13, Match13, APIName14, APIAmts14, APILevels14, FullVals14, Match14, APIName15, APIAmts15, APILevels15, FullVals15, Match15, APIName17, APIAmts17, APILevels17, FullVals17, Match17, APIName18, APIAmts18, APILevels18, FullVals
18, Match18, APIName19, APIAmts19, APILevels19, FullVals19, Match19 , APIName20, APIAmts20, APILevels20, FullVals20, Match20, APIName21, APIAmts21, APILevels21, FullVals21, Match21, APIName22, APIAmts22, APILevels22, FullVals22, Match22, APIName23, APIAmts23, APILevels23, FullVals23, Match23, APIName24, APIAmts24, APILevels24, FullVals24, Match24, APIName25, APIAmts25, APILevels25, FullVals25, Match25 FROM qryReportBaseLevel2 ORDER BY qryReportBaseLevel2.SourceGroup, qryReportBaseLevel2.Source, qryReportBaseLevel2.ProfileID;
When I try to open a recordset based on this sql, it gives me the runtime error - which is odd since I don't have any criteria in the statement.
I think the problem may be that vba is somehow adding a line break between "fullvals" and "18", but I don't know why it would do so and it doesn't always (only if the string is long). Can anyone help?
Thanks!