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!

Default value for combo box

Status
Not open for further replies.

Russ1005

Programmer
Dec 13, 2004
96
US
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?
 
You need to use:

thisform.cboPayeeType.LISTINDEX=1

in your init of the form.

This will highlight the first choice which should be dealer

Don

 
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
 
This code is in the init event of the parent class.
This.Rowsource = LoadMemo(This.Rowsource)
 
I put the following code in the form's init event and it's working now.

DODEFAULT()
thisform.cboPayeeType.Value = 'D'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top