Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need state lookup routine for VFP6.0
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00596981
Message ID:
00597087
Views:
15
>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     && for LostFocus
        llOK = .F.    && for Valid
ENDIF
RETURN llOK           && for Valid
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
Previous
Reply
Map
View

Click here to load this message in the networking platform