Multiple Copies of a report

G

Guest

Windows XP
Access 2000

I have connected 2 PC’s using a cross over cable to form a small network. I
have set 1 printer as a shared printer on the “Master†PC and the setup seems
to work well.

My data file dbase is on the “Master†PC, I have established links to the
data from both PC’s

My problem is that I have created a macro to print 2 copies of a report .
The macro is actioned by a command button on a form. When I action the
command from the “Slave†PC all is well, however when I action the command
from the “Master†PC the printer prints thousands of copies.

I’ve checked the settings as far as I can but am now at a loss.

Any help or advice gratefully received.

Regards

Simon
 
A

Allen Browne

Simon, it's hard to know what is happening without seeing the contents of
the query, but if you are using this database on 2 computers, consider
splitting it into a back end (mdb that contains the tables and is shared)
and a front end (attached tables, and all the other objects - queries,
forms, reports, ...) Once each workstation is running its own copy of the
front end, you avoid the problems that are caused by opening the same mdb on
different machines.

If splitting is a new idea, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html

If you still have problems after doing that, post a followup to this thread,
explaining the action(s) in your macro, and how you are limiting the report
to just the one record. Perhaps it is something like this:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 
G

Guest

Hi Allen,

Thanks for your response, I have set up my database as you suggested ( The
back end Dbase containing tables on the master PC and the front end Bbase
installed on both Master and Slave PC’s) and the links are working.

The command "Print This Invoice" button is located on my Sales Entry form
and actions the following Macro

Print Report Macro :

Macro Name: PrintInvoice

Action:OpenReport
Report Name SalesInvoice
PrintOut
Print Range All
Copies 2
Collate Yes
Close
Object Type Report
Object name SalesInvoice
Save Prompt


The report "SalesInvoice" is based on a query with the Invoice No critera
set as follows :-
[Forms]![SalesEntry]![SalesRef] .

This arrangement works as required on the “Slave†machine, the problem is on
the “Master†machine.

Thanks in advance for any help

Regards

Simon
 
A

Allen Browne

Okay, you have split the database, so that the master and slave computers
are opening *different* mdb files (not the same actual file open on both
machines.) That means the Master has its own separate copy of the SalesEntry
form, and so the query should be able to find the SalesRef text box on the
SalesEntry form, assuming this form is open on the Master machine.

Even if the query were misunderstanding the data type of the SalesRef field,
I would expect it to print *no* records rather than *all* records. It
probably won't help to declare the parameter, but it is always a good idea
anyway, so you could choose Parameters on the Query menu (in query design
view), and in the dialog enter:
[Forms]![SalesEntry]![SalesRef] Long Integer
or "Text" instead of "Long Integer" if SalesRef is a Text type field in the
table.

Any other criteria in this query? I am wondering if there is an OR or
something that is opening the door for extra records. Switch the query to
SQL View (View menu in query design), and paste the SQL statement.

We still have the fact that it works differently on the 2 machines. This
could occur if the machines have different service packs, or different
versions of JET. Locate msaccess.exe, typically in:
C:\Program Files\Microsoft Office\Office
Right-click the file and choose Properties. Check the Version tab. See if it
is the same on both machines.

Then locate msjet40.dll (typically in windows\system32), and see if the
version of that file is different.

Hope one of those suggestions gives you a useful lead.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Simon One said:
Thanks for your response, I have set up my database as you suggested ( The
back end Dbase containing tables on the master PC and the front end Bbase
installed on both Master and Slave PC's) and the links are working.

The command "Print This Invoice" button is located on my Sales Entry form
and actions the following Macro

Print Report Macro :

Macro Name: PrintInvoice

Action:OpenReport
Report Name SalesInvoice
PrintOut
Print Range All
Copies 2
Collate Yes
Close
Object Type Report
Object name SalesInvoice
Save Prompt


The report "SalesInvoice" is based on a query with the Invoice No critera
set as follows :-
[Forms]![SalesEntry]![SalesRef] .

This arrangement works as required on the "Slave" machine, the problem is
on
the "Master" machine.

Thanks in advance for any help

Regards

Simon


Allen Browne said:
Simon, it's hard to know what is happening without seeing the contents of
the query, but if you are using this database on 2 computers, consider
splitting it into a back end (mdb that contains the tables and is shared)
and a front end (attached tables, and all the other objects - queries,
forms, reports, ...) Once each workstation is running its own copy of the
front end, you avoid the problems that are caused by opening the same mdb
on
different machines.

If splitting is a new idea, see:
Split your MDB file into data and application
at:
http://allenbrowne.com/ser-01.html

If you still have problems after doing that, post a followup to this
thread,
explaining the action(s) in your macro, and how you are limiting the
report
to just the one record. Perhaps it is something like this:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top