Upgrade from 97 to 2003

S

scott

I need help with the code below. This worked in 97 but I'm now getting
an error on the line "X = Sheet_qty_Cnfg(Print_Qty, .[Sheet Qty])"
without the quotes in 2003. It is the .[Sheet Qty] in particular.
Thanks for your help!!!

Function Print_PS_Files(strTable As String, PARENT As String, DirName
As String, DirName2 As String, Print_Qty As Long, Printer As String)
As Boolean
Dim PauseTime, Start, finish, TotalTime
Dim dbsTmp As Database, rstTmp As Recordset
Dim StrSearch, PS_File, PrintTray As String

Dim X As Long, Y As Variant
On Error GoTo PROC_ERR

Set dbsTmp = CurrentDb()
Set rstTmp = dbsTmp.OpenRecordset(strTable, dbOpenDynaset)
StrSearch = "parent = '" & PARENT & "'"

With rstTmp
'.FindFirst StrSearch
Do
.FindNext StrSearch
If .NoMatch = False Then
X = Sheet_qty_Cnfg(Print_Qty, .[Sheet Qty])
PrintTray = Print_Tray(.[Sheet Qty])
Y = Make_Header("OFF", "LONGEDGE", X, "Cover Labels for " &
PARENT, PrintTray, "off")
PS_File = .Pn
PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
'Y = CopyFile(DirName2 & PS_File, DirName & "bobl.ps")
If Printer = "mfg" Then
'Y = Shell(DirName & "merge.bat " & DirName2 & PS_File, 6)
Call MFGPrnt(DirName2 & PS_File, "10.0.0.59")
'MsgBox "PS File name = " & PS_File
Else
'Y = Shell(DirName & "mergeoffice.bat " & DirName2 & PS_File,
6)
Call MFGPrnt(DirName2 & PS_File, "10.0.0.60")
End If
End If

PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop

Loop Until rstTmp.NoMatch

.close
End With
dbsTmp.close


PROC_EXIT:
Exit Function
PROC_ERR:
Print_PS_Files = False
MsgBox "Print PS file errored " & Error$
Resume PROC_EXIT

End Function
 
D

Douglas J. Steele

What's the error message you're getting, and what's the definition of
Sheet_qty_Cnfg (which I assume is a function in your application)?
 
S

scott

What's the error message you're getting, and what's the definition of
Sheet_qty_Cnfg (which I assume is a function in your application)?

The error is: Method or data member not found
The Sheet_qty_Cnfg function is: nevermind... see below...

I think I just discovered the problem. I imported everything from 97
into a blank 2003 database. As part of the code conversion, field
names that were not preceded by table names (ie ![Field Name]) changed
the bang(exclamtion point) to a period. It looks like its going to
work once I get them all changed back. I will let you know if that
does the trick.

Thanks so much for your help!
 

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