Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Don't understand this listbox behavior?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00514111
Message ID:
00514131
Views:
23
>I have the following code in a search button on my form. This code controls what is shown in my listbox on the same form, but when I enter a value of say "SMITH" for lastname, the listbox shows me all of the SMITHS and those that alphabetically follow SMITH correctly.
>
>But when I enter a number for the SMITHs such as their ID number such as "7" the listbox shows me the SMITHS and the same list values as when I enter the lastname of "SMITH", but THEN...
>
>The listbox kinda disappears and is replaced by a blue listbox with no rows or columns and I can't see my listbox values any more? Why would this happen when I enter a numeric text value and not when I enter an alpha text value? They are both looking up the same filtered value. I don't get it.
>
>One other clue is that when I put an "m." in front of the fieldnames in the ControlSource of the form, this problem goes away. So it might have something to do with fieldnames and memory variable names.
>
>Any ideas? THANKS VERY MUCH!
>
>
>	THISFORM.List1.RowSourceType = 6
>	IF ISDIGIT(ALLT(lname))
>		SET ORDER TO TAG patid
>		padnum = PADL(ALLT(lname),8,"0")
>		patientid = SUBSTR(patient.patid,1,8)+ALLT(padnum)
>		SET FILTER TO ALLT(patient.patid) => patientid
>	ELSE
>		SET ORDER TO TAG lastname
>		SET FILTER TO patient.lastname => ALLT(lname)
>	ENDIF
>	WITH THISFORM
>		.List1.RowSourceType = 6
>		.List1.Requery
>		.t_ln.SetFocus
>		.Refresh
>	ENDWITH
>
Two ideas, which immediatelly came to mind without serios analyze:

1) Set filter requires to move record pointer, say, locate before with thisform

2) Are you sure, your table will have records satisfying filter condition?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform