Charlotte Foust
cfoust at infostatsystems.com
Mon Dec 11 14:52:41 CST 2006
SQL can't interpret the control references properly. Also, you can't reference the columns in a combobox by name, you have to use the column index. Then you can concatenate the conbobox references into the SQL string in code and use code to set the rowsource to the resulting string. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David A Gibson Sent: Monday, December 11, 2006 10:14 AM To: accessd at databaseadvisors.com Subject: [AccessD] Cascading Listbox I've done cascading Listboxes in the past but want to do something new. I want the first listbox to select a table and the second to display the data in the next. Right now there are three to choose from. I am filtering the first listbox by way of a query. SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Name)<>"MSysObjects" And (MSysObjects.Name)<>"MSysAccessXML" And (MSysObjects.Name)<>"PREV_COMM" AND ((MSysObjects.Type)=1) AND ((MSysObjects.LvProp) Is Not Null)); OR SELECT MSysObjects.Name FROM MSysObjects WHERE (((MSysObjects.Name) Like "tbl*") AND ((MSysObjects.Type)=1) AND ((MSysObjects.LvProp) Is Not Null)); Either method provides a list of the 3 tables for the first listbox. I am having problems with the Row Source for the next Listbox. I have tried variations of: SELECT Forms!frmMain!List17.Item_Code, Forms!frmMain!List17.Descr, Forms!frmMain!List17.Seq_No, Forms!frmMain!List17.Due_Days FROM Forms!frmMain!List17 ORDER BY Forms!frmMain!List17.[Seq_No]; The error I am getting is "Syntax error in FROM clause." Any guidance? David G. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com