CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Lenexa, Kansas
    Posts
    7

    OnBeforeUpdate event not fired

    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



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: OnBeforeUpdate event not fired

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured