LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default CommandButtons and OptionButtons on Userform

Hello

I am having trouble with a Select Case Statement. I have about 6 reports
that I would like one command button to preveiw based on which Optionbutton
is
Selected. This is a code that I use in Access but not having any luck in
excel
can someone tell if this can been done and how

Thanks



Private Sub cmdPrint_Click()

Dim strWhere As String

'strWhere = (DatePicker?)
On Error GoTo PrintPreviewError
Select Case Me.ReportsGroup

Case 1
DoCmd.OpenReport "Payroll-Full Time", acViewPreview, , strWhere
DoCmd.Maximize
Case 2
DoCmd.OpenReport "Payroll-Part-time", acViewPreview, , strWhere
DoCmd.Maximize

Case Else
MsgBox "Select A Report!!!!!!!"
End Select

PPNormalExit:
Exit Sub

PrintPreviewError:

Resume PPNormalExit
Exit Sub

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm OptionButtons Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 4th 07 07:52 PM
Naming UserForm CommandButtons using VBA PCLIVE Excel Programming 2 January 30th 07 04:07 PM
Using For/Next Loop To Generate 4 CommandButtons On A UserForm Results In A Runtime Error 91 Donna[_7_] Excel Programming 4 February 28th 05 01:21 PM
Commandbuttons PCOR Excel Programming 1 May 11th 04 11:21 PM
Need help creating a userform with optionbuttons TB[_2_] Excel Programming 2 July 21st 03 02:16 PM


All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"