Hi, I have this code that I am trying to generate a report
I am getting this error can anyone help thanks
Code:
rivate Sub Cmdprintpreview_Click()
Dim GetDate
Dim strMonth, strYear
Dim ws As Worksheet
Set ws = Sheets("Returns")
'get values from comboboxes
strMonth = Me.Cbomonth.Value
strYear = Me.Cboyear.Value
GetDate = strMonth & "/" & strYear
ws.Range("Period").Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:=GetDate
Unload Me
ActiveSheet.PrintPreview
Selection.AutoFilter
FrmReport.Show