VISUAL BASIC COMMAND NOT RECOGNIZED IN ACCESS 2002

S

SCOTT

Hello, I have a problem with a database built in Access
2000.
The problem is when I click on a command button for a
specific report the report switches to design view and
then the computer commences to print every item in
database! Converting database to 2002 does not help.
Here is the VB code that Access 2002 is not recognizing:

Call parseString(strItems)

Any help would be greatly appreciated!

P.S. "the database works fine in office 2000"

Thank You
Scott
 
D

Dirk Goldgar

SCOTT said:
Hello, I have a problem with a database built in Access
2000.
The problem is when I click on a command button for a
specific report the report switches to design view and
then the computer commences to print every item in
database! Converting database to 2002 does not help.
Here is the VB code that Access 2002 is not recognizing:

Call parseString(strItems)

Any help would be greatly appreciated!

P.S. "the database works fine in office 2000"

Thank You
Scott

"parseString" is not the name of any built-in VBA function, method, or
procedure. So it must be a user-written procedure. Are you sure this
procedure is defined in your database and is in scope at the time it is
called?

I don't see why a failure to recognize this procedure name would cause
Access to "print every item in database". What is the complete code in
the command button's Click event? What is the rest of the code in the
procedure where "parseString" is called?
 
G

Guest

-----Original Message-----


"parseString" is not the name of any built-in VBA function, method, or
procedure. So it must be a user-written procedure. Are you sure this
procedure is defined in your database and is in scope at the time it is
called?

I don't see why a failure to recognize this procedure name would cause
Access to "print every item in database". What is the complete code in
the command button's Click event? What is the rest of the code in the
procedure where "parseString" is called?

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

(please reply to the newsgroup)

My Bad!
It is the following command that produces the results I've
explained: DoCmd.OpenReport stDocName, acNormal
In Access 2000 no problem....In 2002 it changes report
view to design then procedes to print every record in
database, Here is the whole code in the form:

Private Sub cmdPrintMark_Click()
On Error GoTo Err_cmdPrintMark_Click
Dim stDocName As String

DoCmd.OpenReport stDocName, acNormal

Call parseString(strItems)

If Forms!frmCirSelect.booRevised = True Then
Forms!frmCirSelect!lstFound.Requery
Forms!frmCirSelect!lblFound.Caption = "Records
Found: " & Forms!frmCirSelect.getCount(Forms!
frmCirSelect.strFilter)
End If

Exit_cmdPrintMark_Click:
DoCmd.Close acForm, "frmCardPrint"
DoCmd.Close acReport, "PullCard"
Exit Sub

Err_cmdPrintMark_Click:
MsgBox Err.Description
Resume Exit_cmdPrintMark_Click

End Sub
 
D

Dirk Goldgar

It is the following command that produces the results I've
explained: DoCmd.OpenReport stDocName, acNormal
In Access 2000 no problem....In 2002 it changes report
view to design then procedes to print every record in
database, Here is the whole code in the form:

Private Sub cmdPrintMark_Click()
On Error GoTo Err_cmdPrintMark_Click
Dim stDocName As String

DoCmd.OpenReport stDocName, acNormal

Call parseString(strItems)

If Forms!frmCirSelect.booRevised = True Then
Forms!frmCirSelect!lstFound.Requery
Forms!frmCirSelect!lblFound.Caption = "Records
Found: " & Forms!frmCirSelect.getCount(Forms!
frmCirSelect.strFilter)
End If

Exit_cmdPrintMark_Click:
DoCmd.Close acForm, "frmCardPrint"
DoCmd.Close acReport, "PullCard"
Exit Sub

Err_cmdPrintMark_Click:
MsgBox Err.Description
Resume Exit_cmdPrintMark_Click

End Sub

I can't see anything there that ought to have the effect you describe,
or that should behave differently in Access 2002 vs. 2000. However, you
didn't answer my question about parseString(). Is it possible that
there's code in that routine that does something to the report? If you
can post the code in that procedure, please do. If you comment out the
line that calls parseString(), does the report behave the way it should?

Also, I don't see any declaration for strItems, so I have to conclude
that it's declared at a module or global level. I don't know if that is
relevant in any way. Even odder, I don't see any assignment of a value
to stDocName, so you must be leaving something out or this code couldn't
possibly work. If you leave out code, I can't debug it for you.

What report are you actually opening? Is there any code behind the
report, in its Open event perhaps? If so, I'd like to see it.
 
S

Scott

-----Original Message-----


I can't see anything there that ought to have the effect you describe,
or that should behave differently in Access 2002 vs. 2000. However, you
didn't answer my question about parseString(). Is it possible that
there's code in that routine that does something to the report? If you
can post the code in that procedure, please do. If you comment out the
line that calls parseString(), does the report behave the way it should?

Also, I don't see any declaration for strItems, so I have to conclude
that it's declared at a module or global level. I don't know if that is
relevant in any way. Even odder, I don't see any assignment of a value
to stDocName, so you must be leaving something out or this code couldn't
possibly work. If you leave out code, I can't debug it for you.

What report are you actually opening? Is there any code behind the
report, in its Open event perhaps? If so, I'd like to see it.

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

(please reply to the newsgroup)

I figured it out (thanks for the open event tip!) what
happened was by default Access 2000 applied the filters on
open and Access 2002 didn't! Again many thanks!
 

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