Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

combo box problem

combo box problem

combo box problem

When ever I use a comma in a combo box option when adding options manually it places the following text into a new option. How do i get over this?

RE: combo box problem

FoxStudent, you left out exactly what the following text is; also, what combo box option (property?) are you trying to set?

Robert Bradley

FoxDev - Visual FoxPro Development

RE: combo box problem

It took me a few minutes to realize what you are doing. I assume you are populating the recordsource property with your values and setting recordsourcetype to 1-value.

Combo.RecordSource='Hey, This is your only choice.' yields:
Combo.List(2)=' This is your only choice.'

If my assumption is correct, then the behavior you are referring to is by design. Recordsource uses the comma as a delimiter for the values and AFAIK, there isnt a way around that.

Instead of setting recordsource='Hey, This is your only choice.'

Add the item programmatically in the combo's init event.
PROCEDURE Combo.Init()
  THIS.AddItem('Hey, This is your only choice.')

And you should get the results you desire.

Jon Hawkins

Carpe Diem! - Seize the Day!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close