- Local time
- Yesterday, 18:12
- Joined
- Feb 28, 2001
- Messages
- 30,052
I thought I understood text boxes. Suddenly I'm not so sure.
I've got a form with a text box bound to an underlying record. The text box in question has a .ControlSource of a memo field. When I want to add some text to the memo field through a form, it is designed to do things like dynamic control of various command buttons and the navigation controls so that I cannot close the form or navigate away from it until I either COMMIT or CANCEL the pending changes. Safety feature to prevent my users from leaving behind an inconsistent form and bound record.
So in my little routine that tests for a change requiring entry to this "dirty" (no-navigate) state, I check the bound text box to compare the .Value and .Oldvalue properties. I want to do that because I display dirty fields differently than clean ones. However, the little code routine I use runs a sanity check on the control to verify that it has the required property. If it does not, then it takes a "safety" response that says the control has not been edited. Problem is, in the failing case, it has been edited at the time. There is no .Dirty property on a field, only on a form. So I can't scan the form for dirty fields. This means if I want to find out dirty controls, I have to search the form for them. I know to look in the .Text property for unbound controls - but this is a bound control that is supposed to have a .Value, or so I thought.
So when I watch my little sanity checker, what it does is it tries to find a property with the name .Value on a bound text box, as well as .OldValue - but in fact, neither property is there in this case. I double-checked that there is a bound field of the right .ControlSource name in the underlying record and that the bound field can be updated.
Is my problem because a memo field bound to a text box doesn't have a .Value or .OldValue? I.e. is this a MEMO field special case? The Access Help files seem to indicate that it should have that property because there is no note about Memo fields when I look up text boxes. Or did I miss something elsewhere?
I've got a form with a text box bound to an underlying record. The text box in question has a .ControlSource of a memo field. When I want to add some text to the memo field through a form, it is designed to do things like dynamic control of various command buttons and the navigation controls so that I cannot close the form or navigate away from it until I either COMMIT or CANCEL the pending changes. Safety feature to prevent my users from leaving behind an inconsistent form and bound record.
So in my little routine that tests for a change requiring entry to this "dirty" (no-navigate) state, I check the bound text box to compare the .Value and .Oldvalue properties. I want to do that because I display dirty fields differently than clean ones. However, the little code routine I use runs a sanity check on the control to verify that it has the required property. If it does not, then it takes a "safety" response that says the control has not been edited. Problem is, in the failing case, it has been edited at the time. There is no .Dirty property on a field, only on a form. So I can't scan the form for dirty fields. This means if I want to find out dirty controls, I have to search the form for them. I know to look in the .Text property for unbound controls - but this is a bound control that is supposed to have a .Value, or so I thought.
So when I watch my little sanity checker, what it does is it tries to find a property with the name .Value on a bound text box, as well as .OldValue - but in fact, neither property is there in this case. I double-checked that there is a bound field of the right .ControlSource name in the underlying record and that the bound field can be updated.
Is my problem because a memo field bound to a text box doesn't have a .Value or .OldValue? I.e. is this a MEMO field special case? The Access Help files seem to indicate that it should have that property because there is no note about Memo fields when I look up text boxes. Or did I miss something elsewhere?