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


Default value for combo box

Default value for combo box

Default value for combo box

In VFP 7, I have a combo box  where:

boundcolumn = 2
columnlines = .F.
DisplayValue = Dealer
name = cboPayeeType
rowsource = Dealer,D,Manufacturer,M,Distributor,R
rowsourcetype = 1 - Value

I want Dealer/ D to be the default value but it is currently blank on the screen even though displayvalue contains "dealer".  The cboPayeeType.value is 'D' when Dealer is selected, 'M' when Manufacturer is selected, etc.. (boundcolumn 2).

How do I make Dealer the default?

RE: Default value for combo box

You need to use:


in your init of the form.

This will highlight the first choice which should be dealer


RE: Default value for combo box

Actually that displays a 6 which is the rowsource value that is the primary key to a record that contains a memo field that holds the following:  Dealer,D,Manufacturer,M,Distributor,R

RE: Default value for combo box

This code is in the init event of the parent class.
This.Rowsource = LoadMemo(This.Rowsource)

RE: Default value for combo box

I put the following code in the form's init event and it's working now.

thisform.cboPayeeType.Value = 'D'

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!

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