kengooch
Member
- Local time
- Today, 00:24
- Joined
- Feb 29, 2012
- Messages
- 137
I am trying to pass the filtered results of a Form to a Report. The Form has a Combo Box that obtains it's data from the tDept Table which has two fields. tDeptAbbrv and tDeptNm Sample Values:
tDeptAbbrv tDeptNm
ANC Ancillary Testing
Autop Autopsy
BB Blood Bank
tDeptAbbrv is linked to tPlcydpt in the Main tPolicy Table that is used to build the form.
When you select the tDeptAbbrv item it filters the records on the fDept form by tPlcydpt
The ComboBox has the Following Code to filter the records on the fDept form is...
There is a Print Button on the form that then call's the rPolicyReport that I want to show the same records as display on the filtered form above.
This button contains the following Code
When I click the Print button it shows all of the records instead of just the filtered records.
Obviously I'm missing something somewhere, any help would be appreciated.
thanks in advance for your help
tDeptAbbrv tDeptNm
ANC Ancillary Testing
Autop Autopsy
BB Blood Bank
tDeptAbbrv is linked to tPlcydpt in the Main tPolicy Table that is used to build the form.
When you select the tDeptAbbrv item it filters the records on the fDept form by tPlcydpt
The ComboBox has the Following Code to filter the records on the fDept form is...
Code:
Private Sub luDept_AfterUpdate()
On Error GoTo jError
DoCmd.SearchForRecord , "", acFirst, "[tDeptAbbrv] = " & "'" & Screen.ActiveControl & "'"
luDept = Null
DoCmd.GoToControl "luPlcyNm"
GoTo jEnd
jError:
MsgBox Error$
Resume luDept_AfterUpdate_Exit
jEnd
End Sub
There is a Print Button on the form that then call's the rPolicyReport that I want to show the same records as display on the filtered form above.
This button contains the following Code
Code:
Private Sub bPlcyCmplt_Click()
'This Code Handles the Report based upon the Filter selections
MsgBox "pause"
DoCmd.OpenReport "rPolicyComplete", acViewReport, , "tPlcydpt= " & [tPlcydpt]
With Reports("rPolicyComplete")
.OrderBy = "tplcyspID"
.OrderByOn = True
End With
End Sub
When I click the Print button it shows all of the records instead of just the filtered records.
Obviously I'm missing something somewhere, any help would be appreciated.
thanks in advance for your help