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

RowSourceType in combobox with sql-select 2

Status
Not open for further replies.

djolie

Programmer
May 18, 2004
3
RO
I have to generate the RowSource for a combobox with SELECT statement and I do not know the proper code that can help me. (thisform.combo1.Rowsource=?)
 
djolie

You can put your SQL statement directly in the RowSource area of the combobox.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Djolie,

Mike Gagnon has given you one possible way. If you want to do it in code, you can do put this in the combo box's Init:

THIS.RowSourceType = 3
THIS.RowSource = "SELECT Name, City FROM Customer WHERE Amount > 0 INTO CURSOR csrTemp"

Alternatively:

SELECT Name, City FROM Customer WHERE Amount > 0 INTO CURSOR csrTemp
THIS.RowSourceType = 2
THIS.RowSource = "csrTemp"

Mike




Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top