G
geebee
Hi,
I have a date criteria field in my form which opens up a
report after the field has been updated. The report's
programs displayed depend upon values selected from a
multi-select combo box. Here is the AfterUpdate Event
coding:
If Me.programvalue.ItemsSelected.Count = 0 Then
DoCmd.Beep
MsgBox "Please select a program to filter the report
by!", vbInformation, "Attention"
ElseIf Me.filtered_report_button.Visible = False And
Me.reportchooser = "withsummary" Then
'primera forma
'Call SeleccionMult
(Me.ListaClientes, "Program", "Estimates Detail Report")
'segunda forma
Call SeleccionMultipleR
(Me.programvalue, "Program", "Estimates Detail Report")
Me.Visible = False
ElseIf Me.filtered_report_button.Visible = False And
Me.reportchooser = "nosummary" Then
'primera forma
'Call SeleccionMult
(Me.ListaClientes, "Program", "Estimates Detail Report")
'segunda forma
Call SeleccionMultipleR
(Me.programvalue, "Program", "Estimates Detail Report
Without Summary")
Me.Visible = False
End If
***********************************
Here is the code for the CallSeleccionMultipleR:
Public Sub SeleccionMultipleR(cmb As Control, sCampo As
String, _
Inf As String)
'Para abrir o Informes con valores seleccionados
'En un formulario con cuadro de lista múltiple
Dim varItem As Variant, strList As String, strWhere As
String
With cmb
For Each varItem In .ItemsSelected
' Aqui se concatena de la forma deseada
'Para valor campo string & "'" & ",'"
'Para valor campo numerico & ","
strList = strList & .Column(0, varItem) & "'" & ",'"
Next varItem
End With
'Para valor campo string ('" & strList & "')
'Para valor campo numerico (" & strList & ")
strWhere = sCampo & " In ('" & strList & "')"
DoCmd.OpenReport Inf, acPreview, , strWhere
End Sub
I can get the report to open and show the programs
selected by the user. However, there is a problem:
The report opened contains a subreport. I want the
filter to be applied to the subreport also, instead of
just the main report. How can I make this happen.
I have a date criteria field in my form which opens up a
report after the field has been updated. The report's
programs displayed depend upon values selected from a
multi-select combo box. Here is the AfterUpdate Event
coding:
If Me.programvalue.ItemsSelected.Count = 0 Then
DoCmd.Beep
MsgBox "Please select a program to filter the report
by!", vbInformation, "Attention"
ElseIf Me.filtered_report_button.Visible = False And
Me.reportchooser = "withsummary" Then
'primera forma
'Call SeleccionMult
(Me.ListaClientes, "Program", "Estimates Detail Report")
'segunda forma
Call SeleccionMultipleR
(Me.programvalue, "Program", "Estimates Detail Report")
Me.Visible = False
ElseIf Me.filtered_report_button.Visible = False And
Me.reportchooser = "nosummary" Then
'primera forma
'Call SeleccionMult
(Me.ListaClientes, "Program", "Estimates Detail Report")
'segunda forma
Call SeleccionMultipleR
(Me.programvalue, "Program", "Estimates Detail Report
Without Summary")
Me.Visible = False
End If
***********************************
Here is the code for the CallSeleccionMultipleR:
Public Sub SeleccionMultipleR(cmb As Control, sCampo As
String, _
Inf As String)
'Para abrir o Informes con valores seleccionados
'En un formulario con cuadro de lista múltiple
Dim varItem As Variant, strList As String, strWhere As
String
With cmb
For Each varItem In .ItemsSelected
' Aqui se concatena de la forma deseada
'Para valor campo string & "'" & ",'"
'Para valor campo numerico & ","
strList = strList & .Column(0, varItem) & "'" & ",'"
Next varItem
End With
'Para valor campo string ('" & strList & "')
'Para valor campo numerico (" & strList & ")
strWhere = sCampo & " In ('" & strList & "')"
DoCmd.OpenReport Inf, acPreview, , strWhere
End Sub
I can get the report to open and show the programs
selected by the user. However, there is a problem:
The report opened contains a subreport. I want the
filter to be applied to the subreport also, instead of
just the main report. How can I make this happen.