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
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