Is my use of the AfterUpdate and Current Events dangerous?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garyb2008
    New Member
    • Nov 2008
    • 18

    Is my use of the AfterUpdate and Current Events dangerous?

    Hi

    I have a form bound to a stored procedure. I have made it that on changing the value of a list box the form moves forward a record.

    I have done this using the afterupdate event of the list box. Initially the listbox was bound, but i noticed that when i automatically moved forward the listbox got out of sync with the record source. I got round this by making the list box control unbound and using vba to keep it in sync with the record source as follows:

    -In the On Current i update the listbox to the current value of the field.
    -In the after Update event for the listbox it sets the field to the value of the listbox, then sets the list box value to null, then calls the docmd goto acnext command.

    This seems to work great. I read about corruption and errors were AfterUpdate events change the current record, ie upsetting the natural flow of events. Is making the listbox unbound sufficient to avoid this or am i set for corruption on down the line?

    Regards

    Gary
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    I don't see any way that this could create problems.

    Chip

    Comment

    Working...