I have a form with a "Make Copy" button. The database has many records which are very similar in content. This button allows the user to select a record similar to what he wants to enter, make a copy and edit the copy, rather than having to type everything every time. This all works fine.
In order to help cut down confusion, when the duplicate record is created and displayed, I make visible the label border for every field that is filled by code, then when the user exits that field on the form, I hide the label border again. This provides a visual record of which fields have been visited (and possibly changed). This works great as well.
When the user finishes modifying the record, I clear any remaining visible borders in the form's AfterUpdate event, so that all borders are invisible again when the user goes to another record. Once again, all is good.
My problem is when the user leaves the freshly created record -without- having made any changes. There are no changes made, so the AfterUpdate event doesn't fire, and the cautionary borders remain visible. I tried clearing them in the OnCurrent event when the next record comes in, but the code simply doesn't work there. No errors, but nothing happens, the borders remain. Even when I put in a breakpoint and step the code, the borders do not get cleared. Even when I issue the appropriate command in the immediate window, nothing happens, if I do it while within the bounds of the paused OnCurrent event code. The exact same code, running or immediate works fine when called from anywhere else.
I'm using A2007 under Vista. No net search has brought up any posts about this, or at least I haven't found any, but keywords addressing this are common and results number in the hundreds of thousands.
Is there something special about the OnCurrent event that prevents screen updates? Is there another way to clear these borders when leaving an unmodified record? Might there be a better way to do the whole thing?
In order to help cut down confusion, when the duplicate record is created and displayed, I make visible the label border for every field that is filled by code, then when the user exits that field on the form, I hide the label border again. This provides a visual record of which fields have been visited (and possibly changed). This works great as well.
When the user finishes modifying the record, I clear any remaining visible borders in the form's AfterUpdate event, so that all borders are invisible again when the user goes to another record. Once again, all is good.
My problem is when the user leaves the freshly created record -without- having made any changes. There are no changes made, so the AfterUpdate event doesn't fire, and the cautionary borders remain visible. I tried clearing them in the OnCurrent event when the next record comes in, but the code simply doesn't work there. No errors, but nothing happens, the borders remain. Even when I put in a breakpoint and step the code, the borders do not get cleared. Even when I issue the appropriate command in the immediate window, nothing happens, if I do it while within the bounds of the paused OnCurrent event code. The exact same code, running or immediate works fine when called from anywhere else.
I'm using A2007 under Vista. No net search has brought up any posts about this, or at least I haven't found any, but keywords addressing this are common and results number in the hundreds of thousands.
Is there something special about the OnCurrent event that prevents screen updates? Is there another way to clear these borders when leaving an unmodified record? Might there be a better way to do the whole thing?