JGalletta
Windows 7 Access 2010
- Local time
- Today, 17:09
- Joined
- Feb 9, 2012
- Messages
- 149
I think this post will be an exciting learning experience for me.. so here it goes:
I have a form which opens a report based on criteria selected on the form. (This form is used solely to filter, sort, group a report prior to opening it.)
The array of check boxes on the right are Named from top to bottom G1-G12, S1-S12, and D1-D12. G,S,D for Group, Sort, Descending respectively.
What I'm trying to accomplish might be obvious to some of you at this point. I'd like to systematically create the If statements for each check box that creates/appends grouping and/or ordering criteria for the report this form opens when the user clicks "OK".
For example in plain English:
When the user clicks "OK", if a "G" check box is selected, create the grouping criteria for the report (if this needs to be done in an openargs statement, so be it, that's not my main concern at this point). The same would follow subsequently for the sorting and descending check boxes.
I'm thinking the basic code might look something like this:
I'm open to any suggestions about different ways to do this, but I'd like to keep the design of this form the way it is. What are your thoughts about what I'm trying to do, and how can I accomplish this?
I have a form which opens a report based on criteria selected on the form. (This form is used solely to filter, sort, group a report prior to opening it.)

The array of check boxes on the right are Named from top to bottom G1-G12, S1-S12, and D1-D12. G,S,D for Group, Sort, Descending respectively.
What I'm trying to accomplish might be obvious to some of you at this point. I'd like to systematically create the If statements for each check box that creates/appends grouping and/or ordering criteria for the report this form opens when the user clicks "OK".
For example in plain English:
When the user clicks "OK", if a "G" check box is selected, create the grouping criteria for the report (if this needs to be done in an openargs statement, so be it, that's not my main concern at this point). The same would follow subsequently for the sorting and descending check boxes.
I'm thinking the basic code might look something like this:
Code:
Dim intcount As Integer
intcount = 1
For intcount = 1 To 12
If Me.G[B][U](Append/concatenate value of intcount here? - How?)[/U][/B] = True Then
'[I]Add grouping, sorting, descending criteria to report openargs or whatever method works here..[/I]
End If
Next intcount
I'm open to any suggestions about different ways to do this, but I'd like to keep the design of this form the way it is. What are your thoughts about what I'm trying to do, and how can I accomplish this?
Last edited: