Hello All,
I have a form and in that form I have a drop list and I would like to create a report to the from the reference I selected.
Currently when I select the reference item it will pull up all forms with the reference that is selected (This works Great.
What I would like to do is take this to another level. Instead of it opening the form I would like it to open a report. I tried removing "frmShipping" and replacing it with "rptShipping" but I keeping on getting an error. I created a report named rptShipping which is based on a query.
I here is the code I used to open the forms.
Private Sub ReferenceLookup_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmShipping"
stLinkCriteria = "[Reference]=" & "'" & Me![ReferenceLookup] & "'"
DoCmd.Close acForm, "frmReferenceLookUp", acSaveNo
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
This is still new to me so be gentle.
Thanks
Art
I have a form and in that form I have a drop list and I would like to create a report to the from the reference I selected.
Currently when I select the reference item it will pull up all forms with the reference that is selected (This works Great.
What I would like to do is take this to another level. Instead of it opening the form I would like it to open a report. I tried removing "frmShipping" and replacing it with "rptShipping" but I keeping on getting an error. I created a report named rptShipping which is based on a query.
I here is the code I used to open the forms.
Private Sub ReferenceLookup_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmShipping"
stLinkCriteria = "[Reference]=" & "'" & Me![ReferenceLookup] & "'"
DoCmd.Close acForm, "frmReferenceLookUp", acSaveNo
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
This is still new to me so be gentle.
Thanks
Art