G
Guest
I have a parent table that contains information about a sample (when, where,
why taken, etc) and a related table that has records of measurements
performed on the sample (pH, temperature, etc). My form currently displays
the parent table info with the related table info in a subform. This all
works nicely.
Now I have created a popup form to let users create their own filter to view
a subset of the samples. This popup form has a listbox that displays all of
the possible measurements that could be made and then a checkbox to specify
whether to use AND logic or OR logic between the items selected. So they can
say something like give me all of the samples where pH OR temperature are
measured or give me all of the samples where pH AND temperature are measured.
I build a string with a where clause from these selections, pass this as an
openarg to the form to be filtered, and then in the open event of that form I
set the recordsource to "Select * from qrySamples " & Me.OpenArgs.
As I read the Access specifications, I see two things I have to trap for.
First the recordsource string can't be more than 32,750 characters and second
the where clause can't have more than 99 ANDs. Are there other concerns?
The reason I ask is that when I set the recordsource to a string with 82
ANDs and approximately 27,000 characters, I get "error 3048. Can't open any
more databases". The exact same string can be used to create and run a query
just fine. When I test it as a query rather than a recordsource, I can go up
to the 99 ANDs and then I get the "query too complex" error when I try 100
ANDs.
What else should I be trapping for?
why taken, etc) and a related table that has records of measurements
performed on the sample (pH, temperature, etc). My form currently displays
the parent table info with the related table info in a subform. This all
works nicely.
Now I have created a popup form to let users create their own filter to view
a subset of the samples. This popup form has a listbox that displays all of
the possible measurements that could be made and then a checkbox to specify
whether to use AND logic or OR logic between the items selected. So they can
say something like give me all of the samples where pH OR temperature are
measured or give me all of the samples where pH AND temperature are measured.
I build a string with a where clause from these selections, pass this as an
openarg to the form to be filtered, and then in the open event of that form I
set the recordsource to "Select * from qrySamples " & Me.OpenArgs.
As I read the Access specifications, I see two things I have to trap for.
First the recordsource string can't be more than 32,750 characters and second
the where clause can't have more than 99 ANDs. Are there other concerns?
The reason I ask is that when I set the recordsource to a string with 82
ANDs and approximately 27,000 characters, I get "error 3048. Can't open any
more databases". The exact same string can be used to create and run a query
just fine. When I test it as a query rather than a recordsource, I can go up
to the 99 ANDs and then I get the "query too complex" error when I try 100
ANDs.
What else should I be trapping for?