G
Guest
I keep getting an "Object Required" error. I have very little experience in
VBA and could use some help.
Private Sub PrintButton_Click()
On Error GoTo Err_PrintButton_Click
Dim stDocName As String
Dim curGC As Long
curGC = DMax("[GCNum]", "GCItemsTemp") + 1
Do Until GCItemsTemp.EOF = True
With GCItemsTemp
If PRNT.Value = yes Then
.Edit
GCNum.Value = curGC
curGC = curGC + 1
.Update
End If
.MoveNext
End With
Loop
stDocName = "GCPrinter"
DoCmd.OpenReport stDocName, acNormal
Exit_PrintButton_Click:
Exit Sub
Err_PrintButton_Click:
MsgBox Err.Description
Resume Exit_PrintButton_Click
End Sub
Thanks in advance for any help!
VBA and could use some help.
Private Sub PrintButton_Click()
On Error GoTo Err_PrintButton_Click
Dim stDocName As String
Dim curGC As Long
curGC = DMax("[GCNum]", "GCItemsTemp") + 1
Do Until GCItemsTemp.EOF = True
With GCItemsTemp
If PRNT.Value = yes Then
.Edit
GCNum.Value = curGC
curGC = curGC + 1
.Update
End If
.MoveNext
End With
Loop
stDocName = "GCPrinter"
DoCmd.OpenReport stDocName, acNormal
Exit_PrintButton_Click:
Exit Sub
Err_PrintButton_Click:
MsgBox Err.Description
Resume Exit_PrintButton_Click
End Sub
Thanks in advance for any help!