Hello,
I have a report for printing labels on a grid of let's say 3 by 6 on A4 paper. These are peel-off labels, which can be printed either full sheet or just 1, depending on needs.
The report's Record Source is a query, which contains always 18 records (to cover 3x6 grid), and 3 columns: [ID] (1-18), [LabelText] and [Path]. Out of these 18 records sometimes all 18 LabelText and Path are populated, but sometimes only first few (and the rest is empty "" ), but also it could be that say first 4 are empty, then 6 have data and the rest 8 are empty. ID is always populated with numbers 1 to 18. This is done so that labels on A4 are not wasted.
Each printed label should contain different image based on file path given in column [Path]. This is achieved with Dental On Format event
All works with a problem.
I have a report for printing labels on a grid of let's say 3 by 6 on A4 paper. These are peel-off labels, which can be printed either full sheet or just 1, depending on needs.
The report's Record Source is a query, which contains always 18 records (to cover 3x6 grid), and 3 columns: [ID] (1-18), [LabelText] and [Path]. Out of these 18 records sometimes all 18 LabelText and Path are populated, but sometimes only first few (and the rest is empty "" ), but also it could be that say first 4 are empty, then 6 have data and the rest 8 are empty. ID is always populated with numbers 1 to 18. This is done so that labels on A4 are not wasted.
Each printed label should contain different image based on file path given in column [Path]. This is achieved with Dental On Format event
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Image0.Picture = Me.path
End Sub
All works with a problem.
- If all 18 labels are filled, all is correct
- If say first 3 records are filled, then first 3 labels get correct Image, but all the rest of 15 labels also get last image (from label 3)
- If say first 3 records are empty and next 3 records have data and the rest is empty, then first 3 labels have no image (as it should be) labels 4-6 have correct image and the rest again get last image (from label 6)