I have an information form in my database that gives a whole host of data on a user selected Product_ID and separately I have created a pivot chart form that gives the weekly shipments for a chosen Product_ID over 52 weeks.
I added a control button my information form for the user to click so that they can see the weekly shipment data for their selected Product_ID if they want to, but unfortunately when I click on this button, it opens the pivot chart form in design view.
Now I am guessing the issue down to the fact that there is something missing from my control button code, but I have to confess that code writing isn't my forte so I am not sure what I need to change / add to it to get my desired result.
Here is my "On click" "Event Procedure" code below. Any assistance would be greatly appreciated
Private Sub View_Chart_Click()
On Error GoTo Err_Search_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Weekly Shipments"
stLinkCriteria = "[Product_ID]=" & "'" & Me![Product_ID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Search_Click:
Exit Sub
Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click
End Sub