What the H#!! is wrong with this?

G

Gwen H

I am attempting to build a module that will print out 15 different reports to
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function
 
6

'69 Camaro

Hi, Gwen.
What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Whoever designed the database failed to use the "bug-free" naming
conventions for objects and variables. Use only alphanumeric characters and
the underscore and you won't have to chase these time-wasting bugs.

For example:

Me.Product_Specialist_Goals_Incentive.Product_Specialist

.. . . has too many periods in this report's property. There can be only one
period, and it must be placed between the Me and the name of the property.

Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]

.. . . has too many periods in this report's property and has what can
sometimes be interpreted as a minus sign, so subtracting Large
Market.Commercial_Loan_Officer from Commercial Banker Incentive Worksheet may
not be what you intend -- but that's how it's occasionally read by the
computer.

Unless you love chasing bugs and banging your head against the wall
wondering why your code doesn't work on the first try, don't use spaces,
minus signs, dots or any other non-alphanumeric character within the name of
anything you need to apply a name to -- in any computer application. The
underscore character is the only exception to this rule. If you have to
delineate the name with either quotation marks or brackets in any computer
application, then you have a big red flag for potential bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gwen H said:
I am attempting to build a module that will print out 15 different reports to
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function
 
D

Dirk Goldgar

Gwen H said:
I am attempting to build a module that will print out 15 different
reports to my Acrobat Distiller. In the code below, the first two
reports are one page each. The third report is multiple pages. I need
to use the value in one of the report fields as part of the PDF
filename. I am still working on how to handle the multi-page report,
but I don' t even want to address that in this post. What I want to
know is this: Why, when I run the code below, do I get the error
message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat
Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName =
Me.Product_Specialist_Goals_Incentive.Product_Specialist Set
dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large
Market" DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function

I think this code must be in a standard module, not in a form or report
module, yes? The "Me" keyword, which you use in a couple of places, is
only valid in a class module, whether a form or report's code module, or
a class module that you created. "Me" is a reference to the class
module containing the code. In a standard module, as distinct from a
class module, "Me" is not valid because the code isn't running in a
class module.

Assuming I'm right about what's going on, I can't guess what object "Me"
is meant to refer to in the code you posted.
 
G

Gwen H

Just FYI, I didn't design this database. My supervisor's husband, who teaches
computer programming at the university level, did it. The database is huge;
it has tons of complex reports and queries. So renaming reports is not an
option. Any other way around this problem?

'69 Camaro said:
Hi, Gwen.
What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Whoever designed the database failed to use the "bug-free" naming
conventions for objects and variables. Use only alphanumeric characters and
the underscore and you won't have to chase these time-wasting bugs.

For example:

Me.Product_Specialist_Goals_Incentive.Product_Specialist

. . . has too many periods in this report's property. There can be only one
period, and it must be placed between the Me and the name of the property.

Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]

. . . has too many periods in this report's property and has what can
sometimes be interpreted as a minus sign, so subtracting Large
Market.Commercial_Loan_Officer from Commercial Banker Incentive Worksheet may
not be what you intend -- but that's how it's occasionally read by the
computer.

Unless you love chasing bugs and banging your head against the wall
wondering why your code doesn't work on the first try, don't use spaces,
minus signs, dots or any other non-alphanumeric character within the name of
anything you need to apply a name to -- in any computer application. The
underscore character is the only exception to this rule. If you have to
delineate the name with either quotation marks or brackets in any computer
application, then you have a big red flag for potential bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gwen H said:
I am attempting to build a module that will print out 15 different reports to
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function
 
G

Gwen H

Quoting from the book _Access 2003 VBA_: "Me refers to the current object."
So doesn't that mean the object that's currently open, whether it's a table,
form, or report?

Dirk Goldgar said:
Gwen H said:
I am attempting to build a module that will print out 15 different
reports to my Acrobat Distiller. In the code below, the first two
reports are one page each. The third report is multiple pages. I need
to use the value in one of the report fields as part of the PDF
filename. I am still working on how to handle the multi-page report,
but I don' t even want to address that in this post. What I want to
know is this: Why, when I run the code below, do I get the error
message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat
Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName =
Me.Product_Specialist_Goals_Incentive.Product_Specialist Set
dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large
Market" DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function

I think this code must be in a standard module, not in a form or report
module, yes? The "Me" keyword, which you use in a couple of places, is
only valid in a class module, whether a form or report's code module, or
a class module that you created. "Me" is a reference to the class
module containing the code. In a standard module, as distinct from a
class module, "Me" is not valid because the code isn't running in a
class module.

Assuming I'm right about what's going on, I can't guess what object "Me"
is meant to refer to in the code you posted.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
G

Gwen H

Another thought: All I'm trying to do with Me is grab the value of the first
field on the report and use that as part of the filename. Is there another
way besides Me to do this?

Dirk Goldgar said:
Gwen H said:
I am attempting to build a module that will print out 15 different
reports to my Acrobat Distiller. In the code below, the first two
reports are one page each. The third report is multiple pages. I need
to use the value in one of the report fields as part of the PDF
filename. I am still working on how to handle the multi-page report,
but I don' t even want to address that in this post. What I want to
know is this: Why, when I run the code below, do I get the error
message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat
Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName =
Me.Product_Specialist_Goals_Incentive.Product_Specialist Set
dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large
Market" DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function

I think this code must be in a standard module, not in a form or report
module, yes? The "Me" keyword, which you use in a couple of places, is
only valid in a class module, whether a form or report's code module, or
a class module that you created. "Me" is a reference to the class
module containing the code. In a standard module, as distinct from a
class module, "Me" is not valid because the code isn't running in a
class module.

Assuming I'm right about what's going on, I can't guess what object "Me"
is meant to refer to in the code you posted.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
X

xRoachx

Hey Gwen, I pulled this from the MSDN site regarding the Me Property: The Me
keyword provides a way to refer to the specific instance of a class or
structure in which the code is currently executing.

What I think Dirk was getting at is that your code appears to be a module,
correct? Are you calling the module by using a button on a form? If so, the
code would be running within the form from which it was called. In your case,
Access does not know what "Me" is refering to.

On another note, what '69 Camaro was stating about the naming convention was
correct. Since you stated you cannot change this, then another option is to
fully reference the field. For example, for the following field:

Me.Product_Specialist_Goals_Incentive.Product_Specialist

Use this format: Reports!Report Name!FieldName

Reports![Product Specialist
Worksheet]![Product_Specialist_Goals_Incentive.Product_Specialist Set]

Or

Reports![Product Specialist
Worksheet].Controls![Product_Specialist_Goals_Incentive.Product_Specialist
Set]

Gwen H said:
Another thought: All I'm trying to do with Me is grab the value of the first
field on the report and use that as part of the filename. Is there another
way besides Me to do this?

Dirk Goldgar said:
Gwen H said:
I am attempting to build a module that will print out 15 different
reports to my Acrobat Distiller. In the code below, the first two
reports are one page each. The third report is multiple pages. I need
to use the value in one of the report fields as part of the PDF
filename. I am still working on how to handle the multi-page report,
but I don' t even want to address that in this post. What I want to
know is this: Why, when I run the code below, do I get the error
message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat
Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName =
Me.Product_Specialist_Goals_Incentive.Product_Specialist Set
dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large
Market" DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs =
"N:\" & officerName & " Worksheet " & Format(Date, "mmmmyyyy") &
".pdf") DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function

I think this code must be in a standard module, not in a form or report
module, yes? The "Me" keyword, which you use in a couple of places, is
only valid in a class module, whether a form or report's code module, or
a class module that you created. "Me" is a reference to the class
module containing the code. In a standard module, as distinct from a
class module, "Me" is not valid because the code isn't running in a
class module.

Assuming I'm right about what's going on, I can't guess what object "Me"
is meant to refer to in the code you posted.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Gwen H said:
Quoting from the book _Access 2003 VBA_: "Me refers to the current
object." So doesn't that mean the object that's currently open,
whether it's a table, form, or report?

No, it doesn't. It means the class object containing the code that uses
the "Me" keyword.
 
6

'69 Camaro

Hi, Gwen.
Just FYI, I didn't design this database. My supervisor's husband, who teaches
computer programming at the university level, did it.

Many of the people who ask for help in these newsgroups inherited an Access
database that wasn't developed by a professional database developer, so
you're in the same boat. Access requires mastering a steep learning curve.
Your supervisor's husband hadn't reached this level when he wrote this
application, but that doesn't mean he isn't at that level now. (Examination
of prior applications early in one's career will prompt many a "What was I
thinking?!!" or "I must have been in a _REALLY_ big hurry when I wrote
that!!!" -- so my comment isn't the slam it probably sounds like.)
The database is huge;
it has tons of complex reports and queries. So renaming reports is not an
option. Any other way around this problem?

You have three choices with a broken Access database:

1.) Fix it. (You have suggestions, however distasteful you find them, to
consider.)
2.) Get someone else to fix it (such as the original developer, since you
know who he is).
3.) Live with the faults and just manually do the automated operations that
are broken.

Most people choose option # 3 and then:

1.) Bad mouth Access; and/or
2.) Utterly refuse to ever use Access for database development again; and/or
3.) Bad mouth the Access developer; and/or
4.) Utterly refuse to ever use his services again.

But since the developer is your supervisor's husband, he will be immune from
these indignities.

Perhaps you'd be interested in a utility to make the fix-it process as
painless as possible, since I suspect that if anyone is stuck with this task,
it will be you:

http://www.speedferret.com/speedferret.html

Good luck.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gwen H said:
Just FYI, I didn't design this database. My supervisor's husband, who teaches
computer programming at the university level, did it. The database is huge;
it has tons of complex reports and queries. So renaming reports is not an
option. Any other way around this problem?

'69 Camaro said:
Hi, Gwen.
What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Whoever designed the database failed to use the "bug-free" naming
conventions for objects and variables. Use only alphanumeric characters and
the underscore and you won't have to chase these time-wasting bugs.

For example:

Me.Product_Specialist_Goals_Incentive.Product_Specialist

. . . has too many periods in this report's property. There can be only one
period, and it must be placed between the Me and the name of the property.

Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]

. . . has too many periods in this report's property and has what can
sometimes be interpreted as a minus sign, so subtracting Large
Market.Commercial_Loan_Officer from Commercial Banker Incentive Worksheet may
not be what you intend -- but that's how it's occasionally read by the
computer.

Unless you love chasing bugs and banging your head against the wall
wondering why your code doesn't work on the first try, don't use spaces,
minus signs, dots or any other non-alphanumeric character within the name of
anything you need to apply a name to -- in any computer application. The
underscore character is the only exception to this rule. If you have to
delineate the name with either quotation marks or brackets in any computer
application, then you have a big red flag for potential bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Gwen H said:
I am attempting to build a module that will print out 15 different reports to
my Acrobat Distiller. In the code below, the first two reports are one page
each. The third report is multiple pages. I need to use the value in one of
the report fields as part of the PDF filename. I am still working on how to
handle the multi-page report, but I don' t even want to address that in this
post. What I want to know is this: Why, when I run the code below, do I get
the error message "Invalid use of the me keyword" ????

Any help you can provide would be greatly appreciated.

Gwen H

Option Compare Database
Option Explicit
Function setPrinterPDF()
Set application.Printer = application.Printers("Acrobat Distiller")
End Function
Function printPSreports()
Dim officerName As String
DoCmd.OpenReport "Product Specialist Worksheet"
officerName = Me.Product_Specialist_Goals_Incentive.Product_Specialist
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printPBreports()
Dim officerName As String
DoCmd.OpenReport "Private Banking-Relationship Manager"
officerName = Me.Private_Banking_Officer
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.Close
End Function
Function printCBreports()
Dim officerName As String
DoCmd.OpenReport "Commercial Banker Incentive Worksheet-Large Market"
DoCmd.GoToPage 1
officerName = Me.[Commercial Banker Incentive Worksheet-Large
Market.Commercial_Loan_Officer]
Set dlgSaveAs = application.FileDialog(msoFileDialogSaveAs = "N:\" &
officerName & " Worksheet " & Format(Date, "mmmmyyyy") & ".pdf")
DoCmd.PrintOut (acPages = 1)
DoCmd.Close
End Function
 
T

Tim Ferguson

1.) Fix it. (You have suggestions, however distasteful you find
them, to consider.)
2.) Get someone else to fix it (such as the original developer, since
you know who he is).
3.) Live with the faults and just manually do the automated
operations that are broken.

4) Redo it from the ground up, this time correctly...


Tim F
 

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