Check boxes in queries

rodmc

Registered User.
Local time
Today, 13:33
Joined
Apr 15, 2010
Messages
514
Hi Folks

Im looking for some pointers with a small problem that has just arisen while trying to use check boxes on a form.

What I have is a number of check boxes on the form (15 to be precise) that look for obviously check for true or false values within the data set. These check boxes relate to medical conditions.
I have a main form with the controls and then a subform showing the filtered results using said controls. Everything working ok so far.
I now need to export the filtered results to a spreadsheet, So i create another query that relects the controls in the main form in the query parameters, Ive added the text box and combo box controls and everything still working to plan, lastly I need to add the check box crieria and start adding one by one and this works for the first 5 checkboxes but on the 6th, Access tells me the criteria is complex to evaluate?????? I remove the 6th check box, but with the same result :mad: I then remove them one by one and its not until I remove the check box criteria that it works again :confused:

Any ideas???
 
You can create a query on-the-fly in VBA. It should just contain the same SQL as the underlying record source for your form. It is not clear how you filter your data -fo you create a filter based on your checkboxes and use the Me.Filter= "some SQL-conditions"? If so you can retrieve the current filter from the form's Me.Filter, add it to the query, export the data and delete the query.
Check this post http://www.access-programmers.co.uk/forums/showthread.php?t=208324

If the above does not work for you, then post the SQL of your new query that is "to complex" here. Include a few of the checkbox-criteria
 
Sorry Ive not posted the query yet, I had deleted a large part of it trying to get it to work. Will post it ASAP
 

Users who are viewing this thread

Back
Top Bottom