ComboBox lookup on SubForm

G

Guest

I have a combobox based on the value selected in another combo box. On the
form it works fine, but when I add this sub form to the main form it doesn't
work. Here is the statement I have in the rowsource of the second combo box:

SELECT tblConComlkup.txtConComDocTitle FROM tblConComlkup WHERE
(((tblConComlkup.txtConComDoc)=Forms!frmCRMS!txtConComDoc));

When I place this form as a subform in frmMain, it prompts me for the value
of txtconComDoc. What is the syntax for this when it is executed from the
subform?

Thanks all
 
G

Guest

Try:
SELECT tblConComlkup.txtConComDocTitle FROM tblConComlkup WHERE
(((tblConComlkup.txtConComDoc)=Me!txtConComDoc));

I take it you are setting the Rowsource for the second combo in the
AfterUpdate event of the first? Since they are on the same form, you can just
use 'Me'.
 

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