Print every other record in a form

  • Thread starter Thread starter Phillip
  • Start date Start date
P

Phillip

Hi,
I have a continious form that gets selected records from a table. From the
records shown in the form I want to print pages for a book (left-facing,
right-facing). Is there a way to print two reports using the records shown
on my form? One report would select records 1, 3, 5 etc and the second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
Forms are not meant for printing records. I would create a report for
printing. Does each record fill an entire page? It seems like this would be
the only reason why you would want to print even pages and odd pages.
 
Hi Duane,
Each record does not fill a page, but I want each record to be on a separate
page. Is there a way to have a report print every other record in a table
starting with the first record and then have another report to print every
other record starting with record 2?
Thanks,
 
Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height. This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.
 
Hi again,
Before I try that let me ask you another question. I currently have my form
listing the records. Each record has a check box which if it is checked and
I click on my command button for my report, those records print on separate
pages. Just what I want. I also have command bottons on my form that set on
or off the check boxes for all the records. Is there code for a command
button (for example a for/next loop) that would cycle through each record and
for each loop check or uncheck the check box for that record? For example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



Duane Hookom said:
Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height. This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Phillip said:
Hi Duane,
Each record does not fill a page, but I want each record to be on a
separate
page. Is there a way to have a report print every other record in a table
starting with the first record and then have another report to print every
other record starting with record 2?
Thanks,
 
You can run some code to alternate check boxes. Assuming the field name is
ChkBox the following code will work somewhat. The record that has the focus
in the form might not change so you need to watch for this. I just added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP

Phillip said:
Hi again,
Before I try that let me ask you another question. I currently have my
form
listing the records. Each record has a check box which if it is checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form that set
on
or off the check boxes for all the records. Is there code for a command
button (for example a for/next loop) that would cycle through each record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



Duane Hookom said:
Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Phillip said:
Hi Duane,
Each record does not fill a page, but I want each record to be on a
separate
page. Is there a way to have a report print every other record in a
table
starting with the first record and then have another report to print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a report for
printing. Does each record fill an entire page? It seems like this
would
be
the only reason why you would want to print even pages and odd pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
Hi again,
I entered the code and I get a Compile error "User-defined type not defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

Duane Hookom said:
You can run some code to alternate check boxes. Assuming the field name is
ChkBox the following code will work somewhat. The record that has the focus
in the form might not change so you need to watch for this. I just added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP

Phillip said:
Hi again,
Before I try that let me ask you another question. I currently have my
form
listing the records. Each record has a check box which if it is checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form that set
on
or off the check boxes for all the records. Is there code for a command
button (for example a for/next loop) that would cycle through each record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



Duane Hookom said:
Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be on a
separate
page. Is there a way to have a report print every other record in a
table
starting with the first record and then have another report to print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a report for
printing. Does each record fill an entire page? It seems like this
would
be
the only reason why you would want to print even pages and odd pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


Phillip said:
Hi again,
I entered the code and I get a Compile error "User-defined type not defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

Duane Hookom said:
You can run some code to alternate check boxes. Assuming the field name is
ChkBox the following code will work somewhat. The record that has the focus
in the form might not change so you need to watch for this. I just added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP

Phillip said:
Hi again,
Before I try that let me ask you another question. I currently have my
form
listing the records. Each record has a check box which if it is checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form that set
on
or off the check boxes for all the records. Is there code for a command
button (for example a for/next loop) that would cycle through each record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be on a
separate
page. Is there a way to have a report print every other record in a
table
starting with the first record and then have another report to print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a report for
printing. Does each record fill an entire page? It seems like this
would
be
the only reason why you would want to print even pages and odd pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


Phillip said:
Hi again,
I entered the code and I get a Compile error "User-defined type not defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

Duane Hookom said:
You can run some code to alternate check boxes. Assuming the field name is
ChkBox the following code will work somewhat. The record that has the focus
in the form might not change so you need to watch for this. I just added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently have my
form
listing the records. Each record has a check box which if it is checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form that set
on
or off the check boxes for all the records. Is there code for a command
button (for example a for/next loop) that would cycle through each record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the page header
and footer plus the top and bottom margins to equal the paper height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be on a
separate
page. Is there a way to have a report print every other record in a
table
starting with the first record and then have another report to print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a report for
printing. Does each record fill an entire page? It seems like this
would
be
the only reason why you would want to print even pages and odd pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
Phillip,

You will need to go to the Tools - Reference in the VBA Module behind the
form.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


Phillip said:
Hi again,
I entered the code and I get a Compile error "User-defined type not
defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

Duane Hookom said:
You can run some code to alternate check boxes. Assuming the field
name is
ChkBox the following code will work somewhat. The record that has the
focus
in the form might not change so you need to watch for this. I just
added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently have
my
form
listing the records. Each record has a check box which if it is
checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form
that set
on
or off the check boxes for all the records. Is there code for a
command
button (for example a for/next loop) that would cycle through each
record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the page
header
and footer plus the top and bottom margins to equal the paper
height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be on
a
separate
page. Is there a way to have a report print every other record
in a
table
starting with the first record and then have another report to
print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a
report for
printing. Does each record fill an entire page? It seems like
this
would
be
the only reason why you would want to print even pages and odd
pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a
table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and
the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
 
Thank you Duane and Gina. What I have works perfect.
Thanks again,
Phil

Gina Whipp said:
Phillip,

You will need to go to the Tools - Reference in the VBA Module behind the
form.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


Phillip said:
Hi again,
I entered the code and I get a Compile error "User-defined type not
defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

:

You can run some code to alternate check boxes. Assuming the field
name is
ChkBox the following code will work somewhat. The record that has the
focus
in the form might not change so you need to watch for this. I just
added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently have
my
form
listing the records. Each record has a check box which if it is
checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form
that set
on
or off the check boxes for all the records. Is there code for a
command
button (for example a for/next loop) that would cycle through each
record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the page
header
and footer plus the top and bottom margins to equal the paper
height.
This
will print a single record on a page.

Consider adding a new column in your report's record source query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be on
a
separate
page. Is there a way to have a report print every other record
in a
table
starting with the first record and then have another report to
print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a
report for
printing. Does each record fill an entire page? It seems like
this
would
be
the only reason why you would want to print even pages and odd
pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a
table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using the
records
shown
on my form? One report would select records 1, 3, 5 etc and
the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
.
 
More thanks to Duane... I was just passing by!

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Thank you Duane and Gina. What I have works perfect.
Thanks again,
Phil

Gina Whipp said:
Phillip,

You will need to go to the Tools - Reference in the VBA Module behind the
form.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


Phillip said:
Hi again,
I entered the code and I get a Compile error "User-defined type not
defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

:

You can run some code to alternate check boxes. Assuming the field
name is
ChkBox the following code will work somewhat. The record that has
the
focus
in the form might not change so you need to watch for this. I just
added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently
have
my
form
listing the records. Each record has a check box which if it is
checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form
that set
on
or off the check boxes for all the records. Is there code for a
command
button (for example a for/next loop) that would cycle through each
record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the
page
header
and footer plus the top and bottom margins to equal the paper
height.
This
will print a single record on a page.

Consider adding a new column in your report's record source
query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be
on
a
separate
page. Is there a way to have a report print every other record
in a
table
starting with the first record and then have another report to
print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a
report for
printing. Does each record fill an entire page? It seems like
this
would
be
the only reason why you would want to print even pages and odd
pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a
table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using
the
records
shown
on my form? One report would select records 1, 3, 5 etc and
the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
.
 
Gina,
Thanks for the pass-by assistance ;-)

--
Duane Hookom
Microsoft Access MVP


Gina Whipp said:
More thanks to Duane... I was just passing by!

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Thank you Duane and Gina. What I have works perfect.
Thanks again,
Phil

Gina Whipp said:
Phillip,

You will need to go to the Tools - Reference in the VBA Module behind the
form.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


:

Hi again,
I entered the code and I get a Compile error "User-defined type not
defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

:

You can run some code to alternate check boxes. Assuming the field
name is
ChkBox the following code will work somewhat. The record that has
the
focus
in the form might not change so you need to watch for this. I just
added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently
have
my
form
listing the records. Each record has a check box which if it is
checked
and
I click on my command button for my report, those records print on
separate
pages. Just what I want. I also have command bottons on my form
that set
on
or off the check boxes for all the records. Is there code for a
command
button (for example a for/next loop) that would cycle through each
record
and
for each loop check or uncheck the check box for that record? For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the
page
header
and footer plus the top and bottom margins to equal the paper
height.
This
will print a single record on a page.

Consider adding a new column in your report's record source
query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to be
on
a
separate
page. Is there a way to have a report print every other record
in a
table
starting with the first record and then have another report to
print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a
report for
printing. Does each record fill an entire page? It seems like
this
would
be
the only reason why you would want to print even pages and odd
pages.


--
Duane Hookom
MS Access MVP


Hi,
I have a continious form that gets selected records from a
table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using
the
records
shown
on my form? One report would select records 1, 3, 5 etc and
the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
.
.
 
Anytime!

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Gina,
Thanks for the pass-by assistance ;-)

--
Duane Hookom
Microsoft Access MVP


Gina Whipp said:
More thanks to Duane... I was just passing by!

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Thank you Duane and Gina. What I have works perfect.
Thanks again,
Phil

Gina Whipp said:
Phillip,

You will need to go to the Tools - Reference in the VBA Module behind
the
form.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Hi again,
Yet another problem.....
I don't have a "reference" under Tools.
Any ideas?

Duane Hookom said:
You might need to select Tools->References and set a reference to the
Microsoft DAO object library.

--
Duane Hookom
Microsoft Access MVP


:

Hi again,
I entered the code and I get a Compile error "User-defined type not
defined"
on the code:
Dim rs As DAO.Recordset

I'm running Access 2000 if that makes a difference.
Thanks,

:

You can run some code to alternate check boxes. Assuming the field
name is
ChkBox the following code will work somewhat. The record that has
the
focus
in the form might not change so you need to watch for this. I just
added a
command button that runs the code.

Private Sub cmdAlternateChkBox_Click()
Dim booCheck As Boolean
booCheck = True
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
With rs
.MoveFirst
Do Until .EOF
.Edit
!ChkBox = booCheck
.Update
booCheck = Not booCheck
.MoveNext
Loop
.Close
End With

End Sub

--
Duane Hookom
MS Access MVP


Hi again,
Before I try that let me ask you another question. I currently
have
my
form
listing the records. Each record has a check box which if it is
checked
and
I click on my command button for my report, those records print
on
separate
pages. Just what I want. I also have command bottons on my form
that set
on
or off the check boxes for all the records. Is there code for a
command
button (for example a for/next loop) that would cycle through
each
record
and
for each loop check or uncheck the check box for that record?
For
example:

for i = 1 to number of records
if i is even check box on
if i is odd check box off
next i

If this is possible then my current report would work.
Thanks again,



:

Apparently you want the height of the detail section plus the
page
header
and footer plus the top and bottom margins to equal the paper
height.
This
will print a single record on a page.

Consider adding a new column in your report's record source
query:
OddEven: [Enter 1 for Odd or 0 for Even]

I would then try add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over All

Place another text box in the detail section:
Name: txtOddEven
Control Source: [OddEven]
Visible: No

Then add code to the On Format event of the detail section:

Cancel = (Me.txtCount Mod 2 <> Me.txtOddEven)

This is just some "air" code so try it and report back.

--
Duane Hookom
MS Access MVP


Hi Duane,
Each record does not fill a page, but I want each record to
be
on
a
separate
page. Is there a way to have a report print every other
record
in a
table
starting with the first record and then have another report
to
print
every
other record starting with record 2?
Thanks,

:

Forms are not meant for printing records. I would create a
report for
printing. Does each record fill an entire page? It seems
like
this
would
be
the only reason why you would want to print even pages and
odd
pages.


--
Duane Hookom
MS Access MVP


message
Hi,
I have a continious form that gets selected records from a
table.
From
the
records shown in the form I want to print pages for a book
(left-facing,
right-facing). Is there a way to print two reports using
the
records
shown
on my form? One report would select records 1, 3, 5 etc
and
the
second
report would select records 2,4,6, etc.
Your help would be appreciated.
Thanks,
.
.
 
Back
Top