I have attached a simple test application to demonstrate a problem I�m encountering in trying to utilize a variable which is bound to a two state button which in turn is used to control the visibility (using show and hide actions) of a memo field. I need to get this variable conditionally set to different values in the form On Fetch event but its not working.
The gist is that I have a memo field that is intended to act as a sticky note. If a record(s) has a sticky note (determined by the simple fact that the field is not empty) then as each record gets focus the sticky memo field should. If at the time the record gets focus there is no text in the memo then it shouldn�t be displayed. I can get this part to work quite nicely using conditioned show and hide actions in the form On Fetch event. In order to control the display of the sticky memo after the record has received focus for purposes of hiding, showing, or editing I have placed a two state button bound to a logical variable onto the form. In the button On Change event I show or hide the memo field based on conditionals pertaining to the logical value of the variable - .T. to show and .F. to hide. This also works quite except for certain circumstances wherein it may require two pushes of the button to close or open the memo field depending on whether the memo was or wasn�t opened when the record first got focus. The reason for these is easy to deduce. My presumed solution to this would be to place a couple of additional actions in the form On Fetch event to preset the value of the logical variable based on whether or not the memo field already contained text - .T. when text was present and .F. when not. Unfortunately this doesn�t seem to be working the way I would expect. The variable updates in the On Fetch event only seem to work correctly for the very first record opened � they only seem to be recognized for subsequent records if a form refresh is invoked.
I�m kind of stumped at this point.
The gist is that I have a memo field that is intended to act as a sticky note. If a record(s) has a sticky note (determined by the simple fact that the field is not empty) then as each record gets focus the sticky memo field should. If at the time the record gets focus there is no text in the memo then it shouldn�t be displayed. I can get this part to work quite nicely using conditioned show and hide actions in the form On Fetch event. In order to control the display of the sticky memo after the record has received focus for purposes of hiding, showing, or editing I have placed a two state button bound to a logical variable onto the form. In the button On Change event I show or hide the memo field based on conditionals pertaining to the logical value of the variable - .T. to show and .F. to hide. This also works quite except for certain circumstances wherein it may require two pushes of the button to close or open the memo field depending on whether the memo was or wasn�t opened when the record first got focus. The reason for these is easy to deduce. My presumed solution to this would be to place a couple of additional actions in the form On Fetch event to preset the value of the logical variable based on whether or not the memo field already contained text - .T. when text was present and .F. when not. Unfortunately this doesn�t seem to be working the way I would expect. The variable updates in the On Fetch event only seem to work correctly for the very first record opened � they only seem to be recognized for subsequent records if a form refresh is invoked.
I�m kind of stumped at this point.
Comment