set checkbox to true with 10 at a time

Sniperbooya

Registered User.
Local time
Today, 09:54
Joined
Jan 30, 2015
Messages
16
Hi Guys,

I have been messing around with some checkboxes the last couple of days and there's one thing I can not get my head around.

I have got a popupform (continueous) with a a set of checkboxes and a identifier (in my case labnumber).

At this point i select the labnumbers I would like to present on a report (with a max of 10 since A4 is too small to fit more than 4 samples on a report).

Which means, the user has to 'tick' the boxes for the 10 labnumbers he/she would like to report. PDF the report. Untick the labnumbers and select the next 10 samples etc..

Is there a way to do this automatically?

- Select 1-10 (first 10 labnumbers)
- Print
- Select 11-20 (second 10 labnumbers)
- Print
- Select 21-30 (third10 labnumbers)
- Print
- Select 31-40 (fourth 10 labnumbers)

I tried using an update query but only got to the first 10..

Thanks in advance!
 
if you are going to print all the records anyway, you don't need to tick them.
just tell the report to print 10 lines per page.

on your report add a page break control (this must be placed on just below the detail section band and your fieldnames below page break control).

use your form's open event, your detail section format event and your page header format event.
this technique will only be useful in print preview.
Code:
Option Compare Database
Option Explicit

Private linenum As Integer

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    linenum = linenum + 1
    If linenum > 10 Then
        Me.NextRecord = False
        Me.[COLOR=Blue]PageBreak[/COLOR].Visible = True
    End If
    
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    linenum = 0
    Me.[COLOR=Blue]PageBreak[/COLOR].Visible = False
End Sub

Private Sub Report_Open(Cancel As Integer)
    Me.[COLOR=Blue]PageBreak[/COLOR].Visible = False
End Sub

replaced the blue-colored text with the real name of your page break control.
 
Hmm you know what, that might not be a bad idea.
Thanks man, i will have a look at it.
 
Hi Arnelgp,

Do you know if this is possible for a subreport aswell?
Whenever i try to add a pagebreak and use the code it prints the same values across the board.

The subreport's page setup is set to Column Layout : Across, then down with a max number of columns set to 20 (originally set to 10). I dont know if that is messing it up.
 
can you post your db, maybe somebody here knows the answer.
 

Users who are viewing this thread

Back
Top Bottom