Hi,
I have reports inside my NavigationSubForm, and I would like to be able to print that report from a Print button in my Main Form
[Form layout] Main Form with ID combo & Navigation Control (Admin, Clinical, Prescriptions, etc) within Navigation control Admin is another Navigation control with all sorts of reports which get filter on the [ID Combo] in the [Main Menu (Parent Form)].
The problem is that is not the only filter some forms have filters for Dates between which are prompted on open.
So I tried to get the filters but annoyingly it does not return [ID] = '111021'.. it returns [ID] = Parent.Search
This is the code I used to get that filter
I would like to get the solved Filter so i want [ID] = '111021' dates and stuff it seems to get fine because its prompted for.
I even tried making a function on the form that returns the filter, but it returns the same thing [ID] = Parent.Search
..... If we can't get the solved version of this filter then can we some how use Parent.Search and access would know what it's on about? coz Me.Controls("Parent.Search") Definitely doesn't work LOL
Thanks in advanced. I hope I there is a way to do this.. more often that not my questions are simply not doable, which annoys me :banghead:
But obviously the above code doesn't work because when the report is opened for printing it's filter is ID = Parent.Search and because the report doesn't have a parent it prompts me asking me to enter Parent.Search
Edit.. Guess this is another question that cannot be done.. mmm do I leave the thread open ... or mark it as solved? Doesn't seem to have a Close thread button
I have reports inside my NavigationSubForm, and I would like to be able to print that report from a Print button in my Main Form
[Form layout] Main Form with ID combo & Navigation Control (Admin, Clinical, Prescriptions, etc) within Navigation control Admin is another Navigation control with all sorts of reports which get filter on the [ID Combo] in the [Main Menu (Parent Form)].
The problem is that is not the only filter some forms have filters for Dates between which are prompted on open.
So I tried to get the filters but annoyingly it does not return [ID] = '111021'.. it returns [ID] = Parent.Search
This is the code I used to get that filter
Code:
Me.NavigationSubform.Form.NavigationSubform.Report.Filter
I would like to get the solved Filter so i want [ID] = '111021' dates and stuff it seems to get fine because its prompted for.
I even tried making a function on the form that returns the filter, but it returns the same thing [ID] = Parent.Search
..... If we can't get the solved version of this filter then can we some how use Parent.Search and access would know what it's on about? coz Me.Controls("Parent.Search") Definitely doesn't work LOL
Thanks in advanced. I hope I there is a way to do this.. more often that not my questions are simply not doable, which annoys me :banghead:
Code:
Private Sub BTNPrint_Click()
On Error Resume Next
Dim tempReport As Report: Set tempReport = Me.NavigationSubform.Form.NavigationSubform.Report
Dim tempStr As String: tempStr = Me.NavigationSubform.Form.NavigationSubform.SourceObject
Dim CurrentReport As String
If (tempStr Like "Report.*") Then
CurrentReport = Replace(Me.NavigationSubform.Form.NavigationSubform.SourceObject, "Report.", "")
DoCmd.OpenReport CurrentReport, , , tempReport.Filter
Else
MsgBox ("You can only print reports.")
End If
End Sub
But obviously the above code doesn't work because when the report is opened for printing it's filter is ID = Parent.Search and because the report doesn't have a parent it prompts me asking me to enter Parent.Search
Edit.. Guess this is another question that cannot be done.. mmm do I leave the thread open ... or mark it as solved? Doesn't seem to have a Close thread button
Last edited: