Why can Form VBA "see" a field's value but the UI and form reference shows 0
I have an odd situation while adding some business logic to a form. On an Edit record form, this form has several look-up values, each with a record selection form. I use inter-form dialog and opening those record picker forms via the form class to acheve the inter-form dialog.
All have appeared to work great, and I have long since hiddng the fields holding the looked up record ID, and left the "pretty text" field visible.
The one of these I need to add some business logic to, keeps thinking it is returning ID = 0, which is not a valid value. I have unhidden the ID holder field, and indeed it always shows 0.
I unhid another ID field, and that ID field is behaving as expected... holds the ID of the record from the pick list form.
I have added some debugging in the call-back event, and I see the data sail through...
Shows me in the immediate window:
Ideas why the field shows always 0 even though the data is flowing to it?
Later another class tries to interrogate that same field, and that class as well is receiving a 0 value. Yikes, I am suspecting form corruption, and this is one of the two most complicated forms in this application... lots of time to have to rebuild it.
I have an odd situation while adding some business logic to a form. On an Edit record form, this form has several look-up values, each with a record selection form. I use inter-form dialog and opening those record picker forms via the form class to acheve the inter-form dialog.
All have appeared to work great, and I have long since hiddng the fields holding the looked up record ID, and left the "pretty text" field visible.
The one of these I need to add some business logic to, keeps thinking it is returning ID = 0, which is not a valid value. I have unhidden the ID holder field, and indeed it always shows 0.
I unhid another ID field, and that ID field is behaving as expected... holds the ID of the record from the pick list form.
I have added some debugging in the call-back event, and I see the data sail through...
Code:
'If it really did change...
If Me.fldstocktypeid.Value <> ObjResponsePartsPickListValue.id Then
Me.fldstocktypeid.Value = ObjResponsePartsPickListValue.id
Debug.Print "The Response Obj: " & ObjResponsePartsPickListValue.id
Debug.Print "The Field Ctrl: " & Me.fldstocktypeid.Value
Me.fldstocktypetitle.Value = ObjResponsePartsPickListValue.title
...
Code:
The Response Obj: 2
The Field Ctrl: 2
Later another class tries to interrogate that same field, and that class as well is receiving a 0 value. Yikes, I am suspecting form corruption, and this is one of the two most complicated forms in this application... lots of time to have to rebuild it.