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

How to using comma in ComboBox's item 1

Status
Not open for further replies.

kampretable

Vendor
Jan 3, 2008
6
I want to use value that have comma (",") in combobox, for example:

SHM
STNK
SAVING
DEPOSIT
SHM,STNK
SHM,SAVING

If I click the combobox, it look like this:
SHM
SHM
SHM
STNK
STNK ...

How to trik the comma?

NB: I am using plus ("+") to solve the problem,eg SHM+STNK. But my customer still want to use comma !!!
 
Hello kampretable,

Which version of VFP are you using and how are you populating the combo. With a quick test in VFP 9 and using array as a row source I am not seeing that behaviour

Toodles,
Steve Dingle
D&S Business Solutions Ltd
 
Kampretable,

Try this:

Code:
WITH THISFORM.MyCombo
  .RowSourceType = 0
  .AddItem("SHM")
  .AddItem("STNK")
  .AddItem("SAVING")
  .AddItem("DEPOSIT")
  .AddItem("SHM,STNK")
  .AddItem("SHM,SAVING")
ENDWITH

I think the only time a comma would cause problems is if the RowSourceType is 1, which is easy to avoid.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Foxer!

Steve: I am using vfp7 sp1.

Mike: I am trying first, thanks.
 
I tried to change RowSourceType from 1 to 0, it work!
Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top