Hi!
I created a form that has a button and 4 option buttons.I use the following code to export the data to an excel file:
and so on.
now i want to add some check boxes(companies) and combine the filters.I made a query for every possible combination so what i want is this:
if i check option 1 run this query.if i press option 1 AND checkbox1 run this query,and every other possible combination of option buttons and check boxes.Also i want,at least one check box,to be mandatory so if the user didn't click a check box then display a message saying something like "please choose a company".
Thanks
I created a form that has a button and 4 option buttons.I use the following code to export the data to an excel file:
Code:
Dim xlapp As Object
Set xlapp = CreateObject("excel.Application")
On Error Resume Next
If IsNull(Me.Frame22.Value) Then
MsgBox ("You must select a filter!"), vbOKOnly, "Export results"
DoCmd.CancelEvent
Exit Sub
ElseIf Not IsNull(Me.Frame22.Value) Then
Select Case Me.Frame22
Case 1
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "byprinter", "c:\exp_reports\byprinter.xlsm", , "byprinter"
ShellEx "C:\exp_reports\byprinter.xlsm"
'Application.FollowHyperlink "C:\exp_reports\byprinter.xlsm"
xlapp.Quit
Set xlapp = Nothing
ShellEx "c:\users\****\desktop\flwme_reps\byprinter.xlsx"
'Application.FollowHyperlink "c:\users\****\desktop\flwme_reps\byprinter.xlsx"
now i want to add some check boxes(companies) and combine the filters.I made a query for every possible combination so what i want is this:
if i check option 1 run this query.if i press option 1 AND checkbox1 run this query,and every other possible combination of option buttons and check boxes.Also i want,at least one check box,to be mandatory so if the user didn't click a check box then display a message saying something like "please choose a company".
Thanks