Linked Combo Boxes w/SQL Server DB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It worked (from examples) to created linked combo boxes from an access 2003
table, but when I try to do the same from a SQL Server 2000 DB table I get an
error from the SQL Statement Query window.

This code works fine from an access table ...

SELECT weaponSystem, operation
FROM dbo.summaryDB_structure
WHERE (weaponSystem = forms!frmMainMenu!cmbWeaponSystem)
ORDER BY operation

But, when this is a SQL table I get error ...

"ADO error: Line 1: Incorrect syntax near '!'. Statements(s) could not be
prepared. Deferred prepare could not be completed."

Obviously, I need to use a different syntax.

Any help would be greatly appreciated.
 
Hello Scott.

scottM" said:
It worked (from examples) to created linked combo boxes from an
access 2003 table, but when I try to do the same from a SQL Server
2000 DB table I get an error from the SQL Statement Query window.

This code works fine from an access table ...

SELECT weaponSystem, operation
FROM dbo.summaryDB_structure
WHERE (weaponSystem = forms!frmMainMenu!cmbWeaponSystem)
ORDER BY operation

But, when this is a SQL table I get error ...

"ADO error: Line 1: Incorrect syntax near '!'. Statements(s) could
not be prepared. Deferred prepare could not be completed."

SQL Server neither knows about weappons...nor forms or combos.
I think you will have to trigger the after update event of the first one
to target the query of the second one...
Reload the rowsource property of no2 when the event is fired.
 
Thanks Wolfgang. I'm learning that using Access to frontend a SQL server DB
is much different then what the text books show to a mdb. I moved the query
to VBA event handling code and this worked fine.
 
Back
Top