>This VALID method code will only work for certain situations and not for others...
>
> if empty(snum)
> =messagebox('Site # must be selected.', 0, 'Setsite')
> return 0
> endif
>
>I've tried all kinds of things to prevent loss of the focus.
>If I click on certain objects (cmdbuttons) it works, but if I click on a grid, focus goes to the grid.
>If I click on textboxes, I lose focus also.
>
>So, I did a work around by disabling the grid and inserting code in the textbox.gotfocus methods
>which conditionally send the focus back to the combobox. But, I still get a few occurrences of
>double activation of the messagebox in the valid.
>
>Can anyone explain the strange behavior of the VFP5 combobox?? Does VFP6 improve on it?
>Or is my use of >> RETURN 0 << considered an archaic way to keep focus on a combobox???
>
>Thanks.
>
>Steve
Hi Steve,
I don't know if there are any issues with the Valid on combos, but just out of curiosity, have you tried using the LostFocus to implement this? Don't forget, you'll need a NODEFAULT in the LostFocus event to implement there.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.