|
-
Oct 15th, 2002, 08:38 AM
#1
Thread Starter
Banned
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?
-
Oct 15th, 2002, 08:43 AM
#2
PowerPoster
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....
-
Oct 15th, 2002, 08:44 AM
#3
Thread Starter
Banned
Thanx, i've never looked at that event, didn't know what it did
-
Oct 15th, 2002, 08:48 AM
#4
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|