ComboBox Question - Load field from  
Author Message
DETNYRE





PostPosted: Visual FoxPro General, ComboBox Question - Load field from Top

I have a form that has fields from my transaction.dbf database.

I want to add a combo box that lists the customer numbers I have setup in the customer.dbf database.

What I did was to set the RowSource to Data\customer.dbf, and set the RowSourceType to "6 - Fields".

I keep getting "Field Phrase Not Found" error message when I run the form.

I've read through this forum and read the Visual FoxPro 9 help text and I'm still confused.

Any advise

Derek




Visual FoxPro1  
 
 
Aleniko





PostPosted: Visual FoxPro General, ComboBox Question - Load field from Top

Try Setting the RowSource to the fieldname rather than the table name. Like customer.CustomerId.

Aleniko

 
 
DETNYRE





PostPosted: Visual FoxPro General, ComboBox Question - Load field from Top

I tried that and now I'm getting a "clias customer is not found" error message.

I assume I need to open the customer table in the cusotmer database, but I'm not sure where the code should go

Perhaps the Init procedure of the form

Any advise

Derek



 
 
Aleniko





PostPosted: Visual FoxPro General, ComboBox Question - Load field from Top

You should open the Customer table in the dataenvironment for the form. Right click the form's background and select dataenvironment.


 
 
CetinBasoz





PostPosted: Visual FoxPro General, ComboBox Question - Load field from Top

You should have customer table open and have field name(s) in rowsource. However IMHO a better way is to use SQL rowsourcetype. ie:

* Combo init
with this
.RowSourceType = 3
.RowSource = 'select Company,Cust_id from (_samples + "data\customer") into cursor crsCustomer'
.ColumnCount = 2
.BoundColumn = 2
endwith