Rabu, 06 Januari 2016

Re: [MS_AccessPros] Re: Dependent combo boxes

 

Bob-


Assuming this is on a form called frmCars, and the other combo box is named cmbCarNumber, you're really close.

Try this:

SELECT tblCars.CarName, tblCars.CarNumber FROM tblCars WHERE tblCars.CarName=[Forms]![frmCars]![cmbCarNumber] ORDER BY tblCars.CarName;

Note that you were missing some critical spaces in the syntax.  If that doesn't work, tell me what is the Row Source of cmbCarNumber (the SQL or the names of the first several column if you've used the table name), and what is the setting for the Bound Column property.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Jan 5, 2016, at 11:32 PM, bburke@swiftaz.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

OK - I entered )=[Forms]![frmCars]![cmbCarNumber].[Value in the criteria box. I get a parameter dialog box.  When I enter a car name it returns the cars for that car name.  The SQL statement is:



SELECT tblCars.CarName,tblCars.CarNumber FROMtblCars WHERE(((tblCars.CarName)=[Forms]![frmCars]![cmbCarNumber].[Value])) ORDER BY tblCars.CarName;

Bob




__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (15)

.

__,_._,___

Tidak ada komentar:

Poskan Komentar