Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy - but not!? SQL placed into RecordSource property
Message
From
07/10/2004 10:18:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Easy - but not!? SQL placed into RecordSource property
Miscellaneous
Thread ID:
00949531
Message ID:
00949531
Views:
50
The following SQL query works flawlessly for me...
SELECT company.company,company.address FROM ;
company WHERE company.cidcomp in ;
(SELECT DISTINCT Company.cidcomp FROM company INNER JOIN ;
kent!compdesc ON  Company.cidcomp = Compdesc.cidcomp INNER JOIN ;
kent!descrips ON  Compdesc.ciddesc = Descrips.ciddesc INNER JOIN ;
kent!sectorline ON  Descrips.naics = Sectorline.naics INNER JOIN ;
kent!sector ON Sectorline.cidsect = Sector.cidsect WHERE  ;
Sector.sector = ( 'Manufacturing' )) ORDER BY company.company
Now, I need to be able to dynamically place this code into the RecordSource property of a control on my form, but I keep getting an error that "Command contains unrecoginized phrase/keyword." The code I am using is as follows (in the LostFocus event of a ComboBox on the form)
thisform.olecontrol1.recordsource =" SELECT company.company,company.address FROM ;
company WHERE company.cidcomp in ;
(SELECT DISTINCT Company.cidcomp FROM company INNER JOIN ;
kent!compdesc ON  Company.cidcomp = Compdesc.cidcomp INNER JOIN ;
kent!descrips ON  Compdesc.ciddesc = Descrips.ciddesc INNER JOIN ;
kent!sectorline ON  Descrips.naics = Sectorline.naics INNER JOIN ;
kent!sector ON Sectorline.cidsect = Sector.cidsect WHERE  ;
Sector.sector = ( 'Manufacturing' )) ORDER BY company.company"
Can anybody explain to me what I am doing wrong, and how I might be able to get this working as I intend?

Thanks!
On a CLEAR day you can see forever.
Next
Reply
Map
View

Click here to load this message in the networking platform