Hi,
I have a form and a subform. When the form opens it displays all Item Numbers that are for a particular project which is determined when the form opens. That all works correctly. I then have a hyperlink on the Item Numbers and want to open a detailed form for that particular Item number. For some reason it is opening the detailed form for the 1st Item Number for that project.
This is my code for the click event for the Item Number:
Private Sub Item_Nbr_Click()
Debug.Print "Item nbr = "; Me.Item_Nbr
hold_Item_Nbr = Me.Item_Nbr
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiative_Item_Detail", , , "Item_Nbr = " & hold_Item_Nbr, acFormEdit
End Sub
On the Debug.Print value it shows the 1st Item number on the previous form and not the one I clicked.
Would someone know why the Me.Item_Nbr not be the value of the Item_Nbr clicked but be the 1st one listed in the list?
Thanks for any assistance!
I have a form and a subform. When the form opens it displays all Item Numbers that are for a particular project which is determined when the form opens. That all works correctly. I then have a hyperlink on the Item Numbers and want to open a detailed form for that particular Item number. For some reason it is opening the detailed form for the 1st Item Number for that project.
This is my code for the click event for the Item Number:
Private Sub Item_Nbr_Click()
Debug.Print "Item nbr = "; Me.Item_Nbr
hold_Item_Nbr = Me.Item_Nbr
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiative_Item_Detail", , , "Item_Nbr = " & hold_Item_Nbr, acFormEdit
End Sub
On the Debug.Print value it shows the 1st Item number on the previous form and not the one I clicked.
Would someone know why the Me.Item_Nbr not be the value of the Item_Nbr clicked but be the 1st one listed in the list?
Thanks for any assistance!