Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search form slightly misbehaving
Message
De
16/07/2002 23:26:11
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00679248
Message ID:
00679464
Vues:
19
I think the problem is in the control source of your textbox. How do you set it? In design time? How do you intialize the variable? All your problems may be related to the fact the variable is not yet initialized at the time when the textbox object is created and its record source is set. Why do you need the variabnle at all? Why cannot you use just unbound textbox and refer to its Value property in the Click method of the search button? I think< this should solve all the problems.


>I have a search form in VFP 6.0. The form has a textbox to enter search criteria, a listbox to show search results, and a search button.
>
>My search form looks up the correct record, but I have a couple of weird things I can't seem to clear up.
>
>1)I enter the beginning first few letters of my search into a textbox with ControlSource of m.stext, but sometimes search returns a list in my listbox of anything matching the first letter, not matching the first and second letter?
>
>2)I enter the beginning first few letters of my search into a textbox with ControlSource of m.stext, but after I press Search button and go back to the textbox and re-enter another couple of letters and press Search button to further refine the searched list, the listbox turns gray and blank, until I click on the listbox and then the searched list items appear in the listbox?
>
>3)How come in my search textbox where I enter my letters to search on... the text is not selected even though in Property Format there is a !K meaning it should select the text that is in the textbox, but it does not. Or am I misunderstanding the !K?
>
>I have been playing with various settings and commands for awhile and making no headway. Thanks for the help.
>
>Here is my code in my Search Button on my search form:
>
>SELECT agency
>SET FILTER TO
>IF THISFORM.Stype.Value = 1 && Search on Agency Name
>	SET ORDER TO agcy_name
>	SET FILTER TO agency.agcy_name => ALLT(m.stext)
>ENDIF
>IF THISFORM.Stype.Value = 2 && Search on Agency ID
>	SET ORDER TO agency
>	SET FILTER TO agency.agency => ALLT(m.stext)
>ENDIF
>
>IF EOF()
>   GO TOP
>ENDIF
>
>CREATE CURSOR agenc;
>	(agcy_name C(50), agency C(2), code C(2), street C(40), city C(25), ;
>	zip C(12), phone C(20), fax C(20))
>
>REC_CNT=0
>select agenc
>set safety off
>zap
>set safety on
>
>SELECT agency
>SCAN
>	SELECT agenc
>    APPEND BLANK
>    REPLACE agenc.agcy_name WITH ALLT(agency.agcy_name)
>    REPLACE agenc.agency WITH agency.agency
>    REPLACE agenc.code WITH agency.code
>    REPLACE agenc.street WITH ALLTR(agency.street)
>    REPLACE agenc.city WITH ALLT(agency.city)
>    REPLACE agenc.zip WITH ALLT(agency.zip)
>    REPLACE agenc.phone WITH ALLT(agency.phone)
>    REPLACE agenc.fax WITH ALLT(agency.fax)
>    REC_CNT = REC_CNT+1
>    SELECT agency
>ENDSCAN
>IF REC_CNT=0
>   SELECT agenc
>   APPEND BLANK
>   WAIT "NO RECORDS FOUND!!!" WINDOW
>ENDIF
>SELECT agency
>GO TOP
>*THISFORM.Load_list
>*THISFORM.Refresh
>THISFORM.Stext.SetFocus
>
Yuri Rudenko
MCSD, MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform