I'm using this Select Case code in conjunction with a Option Group on a multi-tab form with about 40 run report buttons. The code works fine when included in the Click Event code of a button. I would like to convert it to a function for obvious reasons. I have tried a few variation of a function with no success. What is the best approach for converting a procedure to a function.
Thanks for any and all suggestions
Gil
Code:
Private Sub WhatYear()
Dim strCriteria As String
Select Case Me.Seasons
Case 2009
strCriteria = "[ExpDate] Between #09/01/2009# and #09/01/2010#"
Case 2010
strCriteria = "[ExpDate] Between #09/01/2010# and #09/01/2011#"
Case 2011
strCriteria = "[ExpDate] Between #09/01/2011# and #09/01/2012#"
End Select
DoCmd.OpenReport "rptWeeklyStatus_Asia_Qry", acViewPreview, , strCriteria
Gil
Comment