A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cannot use OpenArgs in Access 2000



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2004, 05:51 PM
Peter Afonin
external usenet poster
 
Posts: n/a
Default Cannot use OpenArgs in Access 2000

Hello:

I created an Access application that uses OpenArgs:

DoCmd.OpenReport stDocName, acPreview, , , , "1"

I created it in Access 2003 (but in Access 2000 format), and it works well.
However, people in my company are using Access 2000, and this doesn't work
on their PCs. They are getting a compile error ("Wrong number of arguments
or method is not supported").

I've checked the references - they are identical to mine, except that they
have Access 9, and I have Access 11. I know that Access 2000 supports
OpenArgs, I verified this in Help. But it even doesn't give this option.
When I type DoCmd.OpenReport, I see this:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition])

That's all.

On my PC I see:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition],
WindowMode as AcWindowMode=acWindowNormal, [OpenArgs])

What could be wrong here?

I would appreciate your help.

Thank you,

--
Peter Afonin


  #2  
Old May 18th, 2004, 06:38 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default Cannot use OpenArgs in Access 2000

"Peter Afonin" wrote in message

Hello:

I created an Access application that uses OpenArgs:

DoCmd.OpenReport stDocName, acPreview, , , , "1"

I created it in Access 2003 (but in Access 2000 format), and it works
well. However, people in my company are using Access 2000, and this
doesn't work on their PCs. They are getting a compile error ("Wrong
number of arguments or method is not supported").

I've checked the references - they are identical to mine, except that
they have Access 9, and I have Access 11. I know that Access 2000
supports OpenArgs, I verified this in Help. But it even doesn't give
this option. When I type DoCmd.OpenReport, I see this:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition])

That's all.

On my PC I see:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition],
WindowMode as AcWindowMode=acWindowNormal, [OpenArgs])

What could be wrong here?


You are mistaken -- Access 2000 does not support OpenArgs for
DoCmd.OpenReport, only for DoCmd.OpenForm. You'll have to use a
workaround of some sort.

Possible workarounds include (a) putting the arguments into a hidden
text box on a form, and having the report pick them up from there, and
(b) using a global variable whose value you set to the desired argument
string just before you open the report -- the report's Open event proc
then grabs the argument value from the variable and clears the variable
for future use.

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

(please reply to the newsgroup)


  #3  
Old May 18th, 2004, 07:01 PM
Peter Afonin
external usenet poster
 
Posts: n/a
Default Cannot use OpenArgs in Access 2000

Thank you, Dirk, I can do that.

I just wonder why I found a full info about OpenArgs in Access 2000 Help?

Peter

"Dirk Goldgar" wrote in message
...
"Peter Afonin" wrote in message

Hello:

I created an Access application that uses OpenArgs:

DoCmd.OpenReport stDocName, acPreview, , , , "1"

I created it in Access 2003 (but in Access 2000 format), and it works
well. However, people in my company are using Access 2000, and this
doesn't work on their PCs. They are getting a compile error ("Wrong
number of arguments or method is not supported").

I've checked the references - they are identical to mine, except that
they have Access 9, and I have Access 11. I know that Access 2000
supports OpenArgs, I verified this in Help. But it even doesn't give
this option. When I type DoCmd.OpenReport, I see this:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition])

That's all.

On my PC I see:

OpenReport(ReportName, View as AcView=acVewNormal, [FilterName],
[WhereCondition],
WindowMode as AcWindowMode=acWindowNormal, [OpenArgs])

What could be wrong here?


You are mistaken -- Access 2000 does not support OpenArgs for
DoCmd.OpenReport, only for DoCmd.OpenForm. You'll have to use a
workaround of some sort.

Possible workarounds include (a) putting the arguments into a hidden
text box on a form, and having the report pick them up from there, and
(b) using a global variable whose value you set to the desired argument
string just before you open the report -- the report's Open event proc
then grabs the argument value from the variable and clears the variable
for future use.

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

(please reply to the newsgroup)




  #4  
Old May 18th, 2004, 07:17 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default Cannot use OpenArgs in Access 2000

"Peter Afonin" wrote in message

Thank you, Dirk, I can do that.

I just wonder why I found a full info about OpenArgs in Access 2000
Help?


Because it is valid for the DoCmd.OpenForm method. Are you saying you
find help text that implies OpenArgs is valid with the OpenReport
method? I just had a quick look in the A2K help, to make sure they
hadn't made a mistake -- as has been known to happen -- but I couldn't
find OpenArgs in conjunction with the OpenReport method or the Report
object.

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

(please reply to the newsgroup)


  #5  
Old May 18th, 2004, 07:19 PM
Peter Afonin
external usenet poster
 
Posts: n/a
Default Cannot use OpenArgs in Access 2000

Thank you, I guess you're correct. It was valid for OpenForm only.

Peter

"Dirk Goldgar" wrote in message
...
"Peter Afonin" wrote in message

Thank you, Dirk, I can do that.

I just wonder why I found a full info about OpenArgs in Access 2000
Help?


Because it is valid for the DoCmd.OpenForm method. Are you saying you
find help text that implies OpenArgs is valid with the OpenReport
method? I just had a quick look in the A2K help, to make sure they
hadn't made a mistake -- as has been known to happen -- but I couldn't
find OpenArgs in conjunction with the OpenReport method or the Report
object.

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

(please reply to the newsgroup)




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.