J
JeanetteJH
I am working on a Inventory database and I have a Purchase Requistion form
that I would like to turn into a report using a command button on the form
for the current record on the form. This form is based on a Purchase
Requsition table and also contains a subform from an Inventory Transacations
query that includes items that I want to order & I want this report to
actually be a Purchase Requistion that can be printed for approval. The form
seems to work fine, and I am using the following code for the command button,
but I keep getting an error that says "The Microsoft Office Access database
engine could not find the object 'PurchaseReqID = 17'. Make sure the object
exists and that you spell its name and the path name correctly.
Private Sub Preview_Purchase_Requisition_Click()
On Error GoTo Err_Preview_Purchase_Requisition_Click
Dim stReportName As String
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False 'saves any changes
stReportName = "rptPurchase Order"
stLinkCriteria = "PurchaseReqID = " & Me!PurchaseReqID
DoCmd.OpenReport stReportName, acPreview, stLinkCriteria
Exit_Preview_Purchase_Requisition_Click:
Exit Sub
Err_Preview_Purchase_Requisition_Click:
MsgBox Err.Description
Resume Exit_Preview_Purchase_Requisition_Click
End Sub
Can anyone tell me what I am doing wrong?
Thanks for any help
Jeanette
that I would like to turn into a report using a command button on the form
for the current record on the form. This form is based on a Purchase
Requsition table and also contains a subform from an Inventory Transacations
query that includes items that I want to order & I want this report to
actually be a Purchase Requistion that can be printed for approval. The form
seems to work fine, and I am using the following code for the command button,
but I keep getting an error that says "The Microsoft Office Access database
engine could not find the object 'PurchaseReqID = 17'. Make sure the object
exists and that you spell its name and the path name correctly.
Private Sub Preview_Purchase_Requisition_Click()
On Error GoTo Err_Preview_Purchase_Requisition_Click
Dim stReportName As String
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False 'saves any changes
stReportName = "rptPurchase Order"
stLinkCriteria = "PurchaseReqID = " & Me!PurchaseReqID
DoCmd.OpenReport stReportName, acPreview, stLinkCriteria
Exit_Preview_Purchase_Requisition_Click:
Exit Sub
Err_Preview_Purchase_Requisition_Click:
MsgBox Err.Description
Resume Exit_Preview_Purchase_Requisition_Click
End Sub
Can anyone tell me what I am doing wrong?
Thanks for any help
Jeanette