Basing subform combo box on mainform combo box

G

Guest

I have a form [A] and a subform [C]. I want to have the user select the
company name in the parent form and then make all choices in the subform's
combo box limited to those applicable to that company. I also want the
choices to be limited to payment with Cash. I tried the following code as
the row source for the subform's combobox but it didn't work-it only returned
the cash options but if I entered a random company name (in which case it
should return zero results) but the options were ones for one of the main
companies. What am I doing wrong? Thanks.

SELECT AOptions.AName FROM AOptions WHERE
AOptions.CompanyName=Parent!CompanyName AND AOptions.Class="Cash";
 
P

Perry

"SELECT AOptions.AName FROM AOptions WHERE AOptions.CompanyName=" & _
Chr(34) & Parent!CompanyName & Chr(34) & " AND AOptions.Class='Cash';"

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top