Two reports onto one label

Malcy

Registered User.
Local time
Today, 17:25
Joined
Mar 25, 2003
Messages
584
Hi
I have got two separate reports that come out on labels about 70mm wide and 35mm high. One covers medicine to be dispensed and one covers a label to go on the bag containing the medicines. There are some common fields between the two. There is not usually a bag label for every person getting medicine.
Currently I print first the medicine labels and then the bag labels as two separate reports, both printed in sequence from a command button.
One of my people now wants to integrate the two labels so that all the medicine for person A comes out together and then the bag label for person A comes out, before the medicine labels for person B.
This is good logic and I am trying to make it work.
My idea was to extend the medicine label report with some additional fields to accommodate the bag label information, and then append the bag label data to the medicine label table. That way I would have some blank fields on every record, depending upon whether it was a bag or a medicine label. So far so good.
Now I try to configure the label! I thought I could overlay fields and if there was null data they would be transparent but they block out what is beneath. The label is already cramped so I cannot lay out so all separate.
I need some code that says if PtAddr is null then do not show the control, and if PtAddr is not null then do not show the DrugName control etc.
I have not coded reports before so not sure how I would structure and where I would put it. Is this possible?
I have hopefully attached a .gif which shows some of the labels (for fictitious people before anyone gets bothered). The bag label is the one at the bottom.
Any help greatly appreciated.
Thanks

Malcy
 
Malcy,


If you go to non-proportional spaced fonts (Courier) then you
can do calculations for the controls of your report in the
Detail Print event.

Me.SomeField.Width = 100 * Len(Me.SomeField) ' just guessing
Me.SomeField.Left = SomeNumber

It will take some work, but it can be done.

Wayne
 
Thanks Wayne
Had a go at that but was having trouble finding the properties for width (am using Access 2003).
Did more searching and eventually came up with something I could adapt so have now simply added some fields to the label and put the following code in the OnFormat event for the report detail

code:
-------------------
If IsNull(Me.PtAddr) Or Me.PtAddr = "" Then
Me.txtPtAddr.Visible = False
Me.LblDoB.Visible = False
Me.txtPtDob.Visible = False
Else
Me.txtPtAddr.Visible = True
Me.LblDoB.Visible = True
Me.txtPtDob.Visible = True
End If
--------------------

This seems to do the trick nicely.
Thanks very much for your help anyway.
Best wishes

Malcy
 

Users who are viewing this thread

Back
Top Bottom