Results 1 to 4 of 4

Thread: Lostfocus - practical problem

  1. #1

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180

    Lostfocus - practical problem

    Hi,

    People, i'm facing a very practical problem:
    I have a listview (set to report view) to display names from my database. When an item is clicked all info about that person is showed. To edit this info I have a second form which loads this info in textboxes to have it edited. But there must be an item selected to be edited so, in the LostFocus event of the listview i disable the Edit button.
    That's ok.

    But when I click the edit button, the lostfocus event is raised and, before the code behind the button has been executed, the button is disabled.
    Is there anything I can do about this?

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Try using Validate instead of LostFocus. Gives option of cancelling the shift...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3

    Thread Starter
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Thanx, i've never looked at that event, didn't know what it did

  4. #4
    Junior Member
    Join Date
    Aug 2001
    Location
    New Hampshire
    Posts
    18
    try checking the listindex property of your listview to be sure the user has selected one of the available options. if the user has not selected an option, the listindex property will be -1. when the edit button is clicked:

    if listview.listindex >= 0 then
    '---allow user to edit
    else
    msgbox "please select an option"
    end if

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