Vulcan1500
Registered User.
- Local time
- Today, 18:29
- Joined
- Nov 13, 2007
- Messages
- 143
In my application I build a strSQL of which the strWhere part is built via a form with selection buttons. After execution a search using the strSQL a number of records are filtered and displayed in a listbox. Then via a preview button a report is made and shown.
So far everything runs as expected and this is also the case when I increase the selection by clicking more selection buttons.
Suddenly, after increasing the selection by clicking an extra button, it fails. The report displays all the data, while the listbox is still showing the data based on the strSQL.
I use the following command to print the data:
This is the content of the strSQL when the problem occurs. In red you can see the extra selection. Before that things ran as expected.
Pls help me with this nasty problem. First I thought I was over the limits of MS Access but I'm unable to find the reason and on top of that any consistancy. Thanks in advance!
So far everything runs as expected and this is also the case when I increase the selection by clicking more selection buttons.
Suddenly, after increasing the selection by clicking an extra button, it fails. The report displays all the data, while the listbox is still showing the data based on the strSQL.
I use the following command to print the data:
Code:
DoCmd.OpenReport "rptExecutedProject", acPreview, strSQL
This is the content of the strSQL when the problem occurs. In red you can see the extra selection. Before that things ran as expected.
Code:
([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkPrimaryActivity] = 11) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkSecondaryActivity] = 11) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkTertiaryActivity] = 11) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkPrimaryActivity] = 12) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkSecondaryActivity] = 12) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkTertiaryActivity] = 12) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkPrimaryActivity] = 13) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkSecondaryActivity] = 13) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkTertiaryActivity] = 13) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkPrimaryActivity] = 14) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkSecondaryActivity] = 14) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkTertiaryActivity] = 14) [COLOR=red]OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkPrimaryActivity] = 15) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkSecondaryActivity] = 15) OR ([DateEnd] BETWEEN #11/20/1998# AND #11/20/2008#) AND ([fkType] = 1 OR [fkType] = 2 OR [fkType] = 3) AND ([fkArea] = 7) AND ([fkTertiaryActivity] = 15)[/COLOR]
Pls help me with this nasty problem. First I thought I was over the limits of MS Access but I'm unable to find the reason and on top of that any consistancy. Thanks in advance!