Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Combo Box to seek on enter or click

Status
Not open for further replies.

amills

Programmer
May 30, 2003
22
US
I am trying to use a combo box to have users input a six digit file number to lookup a record. I have the command in the click event to seek the record and update temporary variables and that works fine. However, when I try and use the keypress event and execute the seek, it finds the wrong record or no record at all. On the screen it shows the correct number. When I put a suspend in and check the variables value, however, it is a completely different number. I want the user to be able to key in the number or click the drop down and select the appropriate record.


Andy
 
Are you using the combo box's Value property or DisplayValue property? You may also need to use ALLTRIM() for character values.
Code:
IF SEEK(ALLTRIM(ThisForm.Combo1.DisplyValue))
   *... Found it
ELSE
   *... Nope
ENDIF


-Dave S.-
[cheers]
Even more Fox stuff at:
 
I suspect you may be using the Value property of the combobox. Try the DisplayValue property instead.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top