Click to See Complete Forum and Search --> : OnBeforeUpdate event not fired


Therese Lewis
September 9th, 1999, 11:15 AM
Hi,

I am very new to VB and using a datagrid control (VB 6). I have coded the
datagrid's OnBeforeUpdate event to perform some validation and set a value
of one of the columns in the updated row for me. If I move off of the row I
am editing by using the arrow keys or clicking on another row in the grid,
the update and OnBeforeUpdate event occur as expected. However, if I click
outside of the grid, the row gets updated, but the code I have in the
OnBeforeUpdate event does not get called.
What am I missing? Is there another event I need to catch or a property of
the datagrid I need to set? I want the automatic updating, but also want to
be able to have a piece of code executed before any updating occurs.

Thanks in advance for your help,
Therese

Lothar Haensler
September 9th, 1999, 11:24 AM
if you want to trap when the user "leaves" a control you can use the Validate event.
By setting the Cancel argument to true you can force the focus on the current control.