Cascading Combo Boxes Access 2010

Martinishaker

New member
Local time
Today, 11:11
Joined
Jan 13, 2012
Messages
1
I have researched and read so much on this topic...I am now thoroughly confused. :confused:
I am comfortable with Access basics,however; building my first database.
I attached a screen shot of code with error message. I have checked spelling ect. Hoping someone can make some sense out of this for me.

Goal is to setup cascading combo's...subformcbo based on mainformcbo selection.
Example attached uses 'afterupdate ' event tied to mainformcbo.

Mainform cmbo box rowsource:
SEECT DISTINCT CustomersExtended.BillTo_AustinID, CustomersExtended.Company
FROM CustomersExtended
ORDER BY CustomersExtended.Company;

thanks in advance, Janice
 

Attachments

First, if you have spaces in your field names then you must use brackets around them as shown below. I try to make it a habit of using brackets for all field names regardless. Second, is cboBillingCustomer text or a number?also check the spelling of CustmersExtended, is that supposed to be Customers? Im sure its error'ing out because of missing quotation marks. I always try to not do line breaks where a numbervariable is needed because you have to use double quotes on it and it gets confusing.



for cboBillingCustomer as a number

Code:
me.subformcboLocationName.Form.Rowsource = "SELECT [Location Name], [Location No], [License], [Exp Date] FROM " & _
" CustomersExtended WHERE " & _
" AustinID = " & me.cboBillingCustomer & " ORDER BY [LocationName]"

as text

Code:
me.subformcboLocationName.Form.Rowsource = "SELECT [Location Name], [Location No], [License], [Exp Date] FROM " & _
" CustomersExtended WHERE " & _
" AustinID = '" & me.cboBillingCustomer & "' ORDER BY [LocationName]"
 

Users who are viewing this thread

Back
Top Bottom