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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with combo box ? 1

Status
Not open for further replies.

FILIPM

Programmer
Mar 11, 2003
40
BE
Hi Guys,

It is probably not a difficult question, but I never did this before.
I have a form with a combo box.
The rowsourcetype is an array which I fill up in the load of the form.
The style property is dropdown combo.
The control source is a memory variable(characters 50 length)
this variable is put to '' at the beginning of the form.
What a want to do is when there is no selection out of my array but just put in a text, the text is not saved.

working with visual fox 7.0 sp1
Any help would be very appriciated

FILIP MERLIER
 
FILIP,
Unless a variable is declared PUBLIC (a bad idea), the variable only exists in the method it is declared in. You should really use a user defined form property to store this value.

Rick
 
Hey Rick,

The variable is a public variable.
All I want to do is put in a manual text which is not in the array.

Are there some opportunities ?


FILIP
 
Filip,

In the Valid event, check the Value property. If it is empty, it means the user has typed in a new value. The string that the user has typed will be in the DisplayValue property. Add that string to the end of the array, and call the combo's Requery method.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Hello Mike,

I did not know how easy things could be.
I'll give you a star for it.
It helps me a lot in my projects because this opens my view
about the possiblity of the combo boxes.


FILIP MERLIER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top