G
Guest
I have run into a problem trying to set a report recordset from a form.
Basically, you can select multiple items into a listbox which builds a query
string:
select * from vwData where Thing='List1' or Thing='List2' or Thing='List3'
......
I then drop that string into this bit of code to set the report recordset:
Set rstData = CurrentDb.OpenRecordset(strSQL)
DoCmd.OpenReport "rptData", acViewPreview
rstData.Close
Set rstData = Nothing
The problem is that once the SQL query string gets above 256 characters, the
report bombs because it looks like the recordset cuts off the string at 256.
If I keep it under 256, it works as expected.
I could not find anything referencing this issue on my initial searches, so
I am hoping someone here might be able to help me with a fix, workaround or
whatever.
THanks,
Jeff
Basically, you can select multiple items into a listbox which builds a query
string:
select * from vwData where Thing='List1' or Thing='List2' or Thing='List3'
......
I then drop that string into this bit of code to set the report recordset:
Set rstData = CurrentDb.OpenRecordset(strSQL)
DoCmd.OpenReport "rptData", acViewPreview
rstData.Close
Set rstData = Nothing
The problem is that once the SQL query string gets above 256 characters, the
report bombs because it looks like the recordset cuts off the string at 256.
If I keep it under 256, it works as expected.
I could not find anything referencing this issue on my initial searches, so
I am hoping someone here might be able to help me with a fix, workaround or
whatever.
THanks,
Jeff