>Hi Jay
>I tried both the listbox & comboboxes. The listbox takes up too much form realestate and the combobox forces the user to open it and navigate with the mouse to select the state you want. What I'm looking for is a "simple" way to let the user type in a 2 digit state code and only open the form if it doesn't find a hit in the state.dbf.
>When describing the fp2.6 routine I forgot the "magic", which is behind the code on line:
>lnTemp = States(Row(),Col())
>"States" is actually a fp2.6 screen program complied and renamed as a .prg file.
>I tried replacing states.prg with a vfp6 form, but don't know how to activate it only when the seek didn't get a hit. Was hoping someone else has traveled down this road. <g>
>Thanks for responding so quickly.
>Bill
Thanks for the fuller information.
One way to approach it is this. It's possible to programmatically trigger the combo box drop down.
The two options will give slightly different behavior, but you can put code as follows in either the Valid or LostFocus events:
IF NOT SEEK (THIS.Value, "States")
KEYBOARD '{ALT+DNARROW}'
NODEFAULT
llOK = .F.
ENDIF
RETURN llOK
Another alternative is to look, on the UT home page, in the Downloads..VFP section. I found 4 searching textboxes by searching on "search". Reminds me of "The Redundant Office of Redundancy...". Using a textbox supported by more code may make a more customizable control.
HTH,
Jay