Can the where condition in the Open Form argument contain a field that is defined as Text in the table used in the form or does it have to be a field that is defined as Number?
I have 2 different forms that have subforms and on the subform one of the fields is a hyperlink with an on click event the performs the below code. The code that is used for the field that is defined as Number in the table design opens the form with the contents of that row. But the code that is used for the field that is defined as Text in the table displays "Enter Parameter Value" then displays the value of the text field I selected. Once I enter the same value in the prompt field and click ok it opens the correct form for that field. A quick note, both integers below in code are defined as String.
Code for Text field:
Private Sub KI_ID_Nbr_Click()
IntID = Me.KI_ID_Nbr 'IntID defined as Global KI_ID As String, Me.KI_ID_Nbr defined as Text in table
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiatives_and_Items", , , "KI_ID_Nbr = " & IntID, acFormEdit End Sub
Code for Numeric field:
Private Sub Item_Nbr_Click()
hold_Item_Nbr = Me.Item_Nbr 'hold_Item_Nbr defined as Global hold_Item_Nbr As String (but Me.Item_Nbr table value is Number and it works!)
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiative_Item_Detail", , , "Item_Nbr = " & hold_Item_Nbr, acFormEdit
End Sub
Appreciate any assistance!
Thanks.
I have 2 different forms that have subforms and on the subform one of the fields is a hyperlink with an on click event the performs the below code. The code that is used for the field that is defined as Number in the table design opens the form with the contents of that row. But the code that is used for the field that is defined as Text in the table displays "Enter Parameter Value" then displays the value of the text field I selected. Once I enter the same value in the prompt field and click ok it opens the correct form for that field. A quick note, both integers below in code are defined as String.
Code for Text field:
Private Sub KI_ID_Nbr_Click()
IntID = Me.KI_ID_Nbr 'IntID defined as Global KI_ID As String, Me.KI_ID_Nbr defined as Text in table
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiatives_and_Items", , , "KI_ID_Nbr = " & IntID, acFormEdit End Sub
Code for Numeric field:
Private Sub Item_Nbr_Click()
hold_Item_Nbr = Me.Item_Nbr 'hold_Item_Nbr defined as Global hold_Item_Nbr As String (but Me.Item_Nbr table value is Number and it works!)
DoCmd.Close acForm, Me.Name, acSaveNo
DoCmd.OpenForm "form_Initiative_Item_Detail", , , "Item_Nbr = " & hold_Item_Nbr, acFormEdit
End Sub
Appreciate any assistance!
Thanks.