3 check boxes named:
1) downloadbox
2) printbox
3) emailbox
Not in a option group since the user may want to download and print or print and email, any combination.
For the on click of the report run button the code starts with:
If Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 0 Then
MsgBox "Choose any combination of Download/Print/E-mail", , "Option Missing"
Else
Which works great, however it is when it comes down to including the options is where it gets messy. Currently the following has been written but none is working, can someone show me where I went wrong. me.format is for the user to choose 1 = report 2= query
If Me.Format = 1 Then
If Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 0 Then
MsgBox "Choose any combination of Download/Print/E-mail", , "Option Missing"
ElseIf Me.Downloadbox = 1 And Me.printbox = 0 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 1 And Me.printbox = 1 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 1 And Me.printbox = 1 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 1 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 1 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
End If
ElseIf Me.Format = 2 Then
DoCmd.OpenForm "SUMMARY TIME AND ATTENDANCE REGISTER", acFormDS, , BuildWhere(Me, "OR")
End If
1) downloadbox
2) printbox
3) emailbox
Not in a option group since the user may want to download and print or print and email, any combination.
For the on click of the report run button the code starts with:
If Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 0 Then
MsgBox "Choose any combination of Download/Print/E-mail", , "Option Missing"
Else
Which works great, however it is when it comes down to including the options is where it gets messy. Currently the following has been written but none is working, can someone show me where I went wrong. me.format is for the user to choose 1 = report 2= query
If Me.Format = 1 Then
If Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 0 Then
MsgBox "Choose any combination of Download/Print/E-mail", , "Option Missing"
ElseIf Me.Downloadbox = 1 And Me.printbox = 0 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 1 And Me.printbox = 1 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 1 And Me.printbox = 1 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.OutputTo acOutputReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 1 And Me.emailbox = 0 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 1 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.PrintOut acPrintAll
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
ElseIf Me.Downloadbox = 0 And Me.printbox = 0 And Me.emailbox = 1 Then
DoCmd.OpenReport "Summary Time and Attendance Register", acViewPreview, , BuildWhere(Me, "OR")
DoCmd.SendObject acSendReport, "Summary Time and Attendance Register", "Snapshotformat(*.snp)"
DoCmd.Close acReport, "Summary Time and Attendance Register"
End If
ElseIf Me.Format = 2 Then
DoCmd.OpenForm "SUMMARY TIME AND ATTENDANCE REGISTER", acFormDS, , BuildWhere(Me, "OR")
End If