Printing Forms causes crashes (1 Viewer)

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
I have just come up with a problem for which I cannot find a solution. I am using MS Access 2010 and when I try to print the current record on a form, the program crashes. I have tried quick print, regular print, print preview first (from the file menu) and still the same result. However, I can print a report without any problem regardless of using the quick print, print preview then print, or just the print (from the file menu) or the vba code DoCmd.PrintOut acSelection, , , acHigh. But that code won't work on the form. I can print a query too, no problem.
This is a split DB, the front end on a work station and the back end on the server.
I tried this on a personal DB which is only on my workstation and there are no problems whatsoever.
Synopsis: On the split DB the printing of forms causes DB to crash. The printing of reports and queries work fine. On a DB entirely on an individual workstation, everything prints OK, forms, reports, queries.
I have tried this on different workstations in the office with the same result. Does not matter is the print request is sent to a local printer or the network printer.
Any thoughts?
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
I have also figured out that if the underlying table is not very large, I can print the current form record. However, if the underlying table is large, it causes a crash. Doesn't matter if the Back end is on the server or the DB is not split.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
Anyone have any suggestions regarding this problem? I am not sure where to start. Seems to me that it might be a server problem, but then the same thing occurs on my home computer with the same DB, and it is not split. Thanks.
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
I think the reason this thread is still waiting for a reply is because most people use Reports for printing not Forms and having not experienced this type of error hard to say what's happeneing. So, it begs the question, why aren't you using a Report?

All that said, can you post the entire section you are using to print the Form.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
I fully agree with you regarding using reports instead of a form. And I am working on that. But the confusing part was why the current record would not print. The code:
DoCmd.PrintOut acSelection, , , acHigh

should print out the current record. I did try this on a form with a much smaller underlying table and it works fine. I thought maybe it was not selecting the current record (form), so I selected the current form and tried to print it, but it also crashes the DB.

When you mean post the entire section, do you mean the form and the underlying table? The table has 20K+ records. That would be too large to post. Or do you mean something else.
 

vbaInet

AWF VIP
Local time
Today, 13:44
Joined
Jan 22, 2010
Messages
26,374
And let's see the Record Source of your form as well. If it's a query show us the SQL.

One thing to try is to isolate the form by copying and pasting it into a new blank db and try printing from there. There may be something wrong with just that form.

Also, can you print other forms? Not that you should be printing forms anyway (like Gina mentioned).
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
Hmm, well, when printing a Form and wanting the current record...

Code:
Dim myForm As Form
Dim PageNo As Integer
 
PageNo = Me.CurrentRecord
Set myForm = Screen.ActiveForm
 
DoCmd.SelectObject acForm, myForm.Name, True
DoCmd.PrintOut acPages, PageNo , PageNo , , 1
DoCmd.SelectObject acForm, myForm.Name, False
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
Oops, what I meant by the entrie section was, I thought you had more than just that one line to print the current record of the Form.
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
I should also point out that your way, you are not *selecting* anything, so, if memory serves me correctly, your line is trying to print a Form for each record in your Record Source. This may be why it's crashing, it's *over loading*. You need to *point it* to the current record.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
Well, I do not know how I am going to send you the table and form since they are (1) so large and (2) have so many underlying links to other tables and queries that it is hard to open the form without me deleting most of the underlying code in it. So I will try your suggestion when I have access to the split DB at work on Monday. That is, I will copy and past the form and table to a new DB, and try it from there.

But moreover, I will work on a report alternative to it. It is hard to get people to stop doing things that they did with the old DOS based DB (printing the current record was easy) and using the forms and reports that I have set up for them in the new Access DB.

Appreciate all the help. Will update on Monday.

Thanks.
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
Before you go thru all of that... see if my code stops the crashing. If it does then all is right in the world and you can work on your report in your leisure.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
I was able to log on to my office computer remotely via LogMeIn (not the easiest thing to use), and tried the code. When I used the code in the form with the 20K plus records, the db crashed. Then I tried it on a form that had maybe 400+ records and it works fine. So it must have something to do with the number of records in the underlying table or, with the way the print spooler is set up, or, with the way the server handles it.

I tried the code on my home computer with the form and the large table and it worked fine. That Db is split, but both the front end and the back end are in the same folder.

So I am going to try it on Monday at work, on one or more computers and see if has something to do with the way the printers are set up or the server is configured.

And I am going to make a report to mimic as best possible the form. Thanks. Will update you on Monday.
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
You just said something interesting...

That Db is split, but both the front end and the back end are in the same folder.

The Front end should be on your Local and the Backend on the Server. I wonder if the fact that Front end is not on your Local is the problem? :confused:

Side note: I hate LogMeIn also switched to Team Viewer.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
The BE is on the server, the FE on a local workstation. This is at work where the problem is occurring. When they are both on a workstation (at home) but split, the problem goes away. That is why I have to wait until Monday to see what happens. BE on server, FE on workstation.
 

Eljefegeneo

Still trying to learn
Local time
Today, 05:44
Joined
Jan 10, 2011
Messages
904
I finally had a chance to test your code today at work. It works fine if the number of records in the underlying table is small. But when I try to print the form with the underlying table with 20K plus records, the DB crashes. I suppose I could spend more hours on this trying to solve it, but since it is probably a printer/server/something else issue and not really a Access issue, I decided to go the report route. Did that and the users are happy.
Thank you for your help. This will just have to remain one of those mysteries that do not need to be solved, but rather solved the correct way, forms are for entering data and looking at, reports are for printing!
 

GinaWhipp

AWF VIP
Local time
Today, 08:44
Joined
Jun 21, 2011
Messages
5,900
Thank you for the update and for letting everyone know... print Reports! :D Glad it worked out for your Users...
 

Users who are viewing this thread

Top Bottom