473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

'Inexplicable' omission (not deletion) of records - see code at end of message


I work at a Community College. I have been using Access for 4 years
to track the number and destinations of transcripts we mail out at
students' (and former students' requests). It has worked fine, until
very recently.

I type in the number of envelopes I wish the Database to print and it
prints out the correct number of envelopes, accordingly -- up until 2
weeks ago.

Now, there is no rhyme nor reason to the number of envelopes the
Database will print.

I created a Report to perform this task, but it appears the formatting
of the Report is to blame for the omission of some of the envelopes.

When I create a tabular report - ALL - of the records are there! But,
then, when I try to create an envelope report (and adjust margins),
there are records omitted.

Does anybody have any idea what would be wrong with my report/
formatting?

My IT department is of -NO- help to me.

Here is the code for printing the envelopes, but again, I don't think
the code is causing the problem:

*****************

Option Compare Database

Dim intPrintCounter As Integer
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If (intPrintCounter < [Number of transcripts to this institution])
Then
intPrintCounter = intPrintCounter + 1
Me.NextRecord = False
Else
intPrintCounter = 1
Me.NextRecord = True
End If

End Sub

Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1

End Sub

Jun 18 '07 #1
3 1507
Hi Arne,

Try this for starters: Look at the recordsource of the report - the
query/table and look at the row count in that table/query. Then run
your report without printing - just the report. Go to the end of the
report (click the End Button at the bottom of the report). The count of
records (pages) should match the count from the recordsource. If your
report only prints, then create a new report that only displays the
records (envelopes). The counts should match. If the counts match then
just print that report from the print button on the menubar. No real
need for code here.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 18 '07 #2
Arne Reed wrote:
I work at a Community College. I have been using Access for 4 years
to track the number and destinations of transcripts we mail out at
students' (and former students' requests). It has worked fine, until
very recently.

I type in the number of envelopes I wish the Database to print and it
prints out the correct number of envelopes, accordingly -- up until 2
weeks ago.

Now, there is no rhyme nor reason to the number of envelopes the
Database will print.

I created a Report to perform this task, but it appears the formatting
of the Report is to blame for the omission of some of the envelopes.

When I create a tabular report - ALL - of the records are there! But,
then, when I try to create an envelope report (and adjust margins),
there are records omitted.

Does anybody have any idea what would be wrong with my report/
formatting?

My IT department is of -NO- help to me.

Here is the code for printing the envelopes, but again, I don't think
the code is causing the problem:

*****************

Option Compare Database

Dim intPrintCounter As Integer
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If (intPrintCounter < [Number of transcripts to this institution])
Then
intPrintCounter = intPrintCounter + 1
Me.NextRecord = False
Else
intPrintCounter = 1
Me.NextRecord = True
End If

End Sub

Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1

End Sub
Why are you using 1 as the initializer? What if you only had 1 tx to
print...you set the counter to 1 and you expect to only print if less
than...so that record should never print. IOW, only those with 2 or
more txs should print...if I am reading your code correctly.

Jun 19 '07 #3
Arne, the code you posted will indeed behave wrongly, unless you print all
pages of the report.

For an explanation of why and an alternative approach, see:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Arne Reed" <ar***@sccd.ctc.eduwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
>
I work at a Community College. I have been using Access for 4 years
to track the number and destinations of transcripts we mail out at
students' (and former students' requests). It has worked fine, until
very recently.

I type in the number of envelopes I wish the Database to print and it
prints out the correct number of envelopes, accordingly -- up until 2
weeks ago.

Now, there is no rhyme nor reason to the number of envelopes the
Database will print.

I created a Report to perform this task, but it appears the formatting
of the Report is to blame for the omission of some of the envelopes.

When I create a tabular report - ALL - of the records are there! But,
then, when I try to create an envelope report (and adjust margins),
there are records omitted.

Does anybody have any idea what would be wrong with my report/
formatting?

My IT department is of -NO- help to me.

Here is the code for printing the envelopes, but again, I don't think
the code is causing the problem:

*****************

Option Compare Database

Dim intPrintCounter As Integer
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If (intPrintCounter < [Number of transcripts to this institution])
Then
intPrintCounter = intPrintCounter + 1
Me.NextRecord = False
Else
intPrintCounter = 1
Me.NextRecord = True
End If

End Sub

Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1

End Sub
Jun 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tuhin Kumar | last post by:
Hi, I have a requirement on improving the deletion rate on on records of a table. The table contains 5 million records, but since deleting everything matching the condition at one go was giving...
3
by: Chumley the Walrus | last post by:
IN my code behind .vb page for a delete records script (this also does a deletion confirmation with a javascript popup, this gets called on my front .aspx page with the datagrid), I'm not sure if...
5
by: Jack | last post by:
Hi, I am trying to get a thorough understanding of a code where a addition or deletion of records can be done from a list of records. For addition part of the form, data is being obtained from set...
4
by: Peeter Ups | last post by:
I have several tables in my database. I use these to create 'quotations' that show product code, description, selling price and quantity required. Users can enter as many lines as possible and a...
3
by: deekay | last post by:
I'm using Access 2000 working in DAO at the moment and am having trouble deleting a record from a form that has been filtered. So I'm filtering a form and then when the user selects the record...
0
by: ME | last post by:
I can't seem to delete records using an objectdatasource. The object is a Typed Collection built by Visual Studio that access a SQL Database. When I try to delete using the ObjectDataSource it...
0
by: ASMJ | last post by:
Hi, I have a gridview in my page, which displays all records from an sqldatasource. The delete row command is available to the user, through which he can perform deletion. I want to trap the...
7
by: EManning | last post by:
Using A2003. I'm receiving this error when returning from a "DoCmd.OpenReport..." statement. I have a tab control with a subform on every tab. The user selects an item from a combobox at the top...
31
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.