Apschminkey
MIS
I am making changes to a commercial laboratory LIMS system that our company uses to track and report test samples. We have a document called a “Lab Sheet” which is used to document various pieces of information before the data is entered into the computer. Currently, to print these lab sheets I have a form with a combo box from which the user can select an order number. An order is a collection of samples from single client. Each sample may have one or more tests assigned to it. The query which feeds the report takes the selected order number and finds all of the tests which are assigned to the samples in the order. A single Lab Sheet is printed for each test. The details section includes a list of test parameters associated with a particular test. People here are not happy with the simple list of test parameters and would like to design custom Lab Sheets for many of the tests. What I would like to do is create a single lab sheet having the normal headers/footers EXCEPT that the body of the report is produced by a subreport. All of the possible subreports for all of the possible tests would be placed on the main report. When test "X" comes up in the query, I would like to make visible ONLY the subreport corresponding to the lab sheet required for Test "X". If the next sheet to be printed is test "Z", I would like to print a sheet with only the test "Z" subreport. I found a piece of code (below) online which was written in response to a guy who was looking for a way to control the printing of a subreport.
--------------------------------------------------------
In the "On Page" event of the report, put the following code:
If YourFlag=True then
Me.subformname.Visible = False
Else
Me.subformname.Visible = True
End If
---------------------------------------------------------
Could I do something like:
If testName1=True then
Me.subformname.visible=true
If testname2=True then
Me.subformname.visible=true
If testname3=True then
Me.subformname.visible=true
If testname4=True then
Me.subformname.visible=true
Else
Me.DefaultSubform.visible=true
End if
The If/Else block is probably not correct (I struggle with that all the time) but I think you can see where I'm going with it. Am I on the right track?
Thanks!
--------------------------------------------------------
In the "On Page" event of the report, put the following code:
If YourFlag=True then
Me.subformname.Visible = False
Else
Me.subformname.Visible = True
End If
---------------------------------------------------------
Could I do something like:
If testName1=True then
Me.subformname.visible=true
If testname2=True then
Me.subformname.visible=true
If testname3=True then
Me.subformname.visible=true
If testname4=True then
Me.subformname.visible=true
Else
Me.DefaultSubform.visible=true
End if
The If/Else block is probably not correct (I struggle with that all the time) but I think you can see where I'm going with it. Am I on the right track?
Thanks!