M
mlieberstein
I have a report based on a query. I have a form that needs two pieces of
data to run:
· A text box [txtYMV]: User enters a yearmonthvalue (yyyymm)
· A combo box [cboBusinessGroup]: User selects a Business Group from a table.
Once these boxes are selected, there's a command button [cmd_OpenReport]
that opens the report based on the two criteria, and here's my problem.
(Please be gentle...I'm a newbie coder) Below is the code I'm trying to
use:
Private Sub cmd_OpenReport_Click()
Dim strWhere As String
If Not IsNull(Me.txtYMV) And IsNull(Me.cbxBusinessGroup) Then
strWhere = " AND [txtYMV] =""" & Me.txtYMV & """ " _
And strWhere & " AND [Business Group I] = '" & Me.cbxBusinessGroup & "'"
End If
DoCmd.OpenReport "BusinessGroupReport_rpt", acViewPreview, strWhere
End Sub
Any Help is much appreciated
data to run:
· A text box [txtYMV]: User enters a yearmonthvalue (yyyymm)
· A combo box [cboBusinessGroup]: User selects a Business Group from a table.
Once these boxes are selected, there's a command button [cmd_OpenReport]
that opens the report based on the two criteria, and here's my problem.
(Please be gentle...I'm a newbie coder) Below is the code I'm trying to
use:
Private Sub cmd_OpenReport_Click()
Dim strWhere As String
If Not IsNull(Me.txtYMV) And IsNull(Me.cbxBusinessGroup) Then
strWhere = " AND [txtYMV] =""" & Me.txtYMV & """ " _
And strWhere & " AND [Business Group I] = '" & Me.cbxBusinessGroup & "'"
End If
DoCmd.OpenReport "BusinessGroupReport_rpt", acViewPreview, strWhere
End Sub
Any Help is much appreciated