The idea will be to build up a string to use in the Filter of your form.
This example assumes check boxes named chk1, chk2, ...chk12, and a date/time
field to filter on named SalesDate:
Dim i As Integer
Dim lngLen As Long
Dim strWhere As String
For i = 1 to 12
If Me("chk" & i).Value Then
strWhere = strWhere & i & ","
End If
Next
lngLen = Len(strWhere) - 1 'Without trailing comma
If lngLen > 0 Then
strWhere = "Month([SalesDate]) IN (" & Left$(strWhere, lngLen) & ")"
Me.Filter = strWhere
Me.FilterOn = True
Else
Me.FilerOn = False
End If
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Neji" <ji********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
greeting all,
I am building a form for my company to filter out some sales figures
for different months. anyway, here is my idea
i have 12 checkboxes represeting each months.
users will select any checkboxes they want to view the sales figures
for that month
they can choose more than 1 month
for example if they choose checkboxes 1,5,7; that means they will be
shown the sales figures for month 1,5,7
is there any way to do some things?
thanks very much in advanced.