How to reference a control value in a row source query?

  • Thread starter new2access123 via AccessMonster.com
  • Start date
N

new2access123 via AccessMonster.com

How to reference a control value in a row source query?

I have two combo boxes on a form the value of cboA I want to use in the row
source SELECT of cboB. In the query designer for the row source of cboB I
have entered for the WHERE clause:

=[Forms]![form_form1]![cboProjectName]

I have left the Access default form names

The actual SELECT from the SQL View is

SELECT ProjectToParticipant.ProjectID, Participant.NameLast, Participant.
NameFirst, Participant.NameMiddle
FROM Participant INNER JOIN ProjectToParticipant ON Participant.ParticipantID
= ProjectToParticipant.ParticipantID
WHERE (((ProjectToParticipant.ProjectID)=[Forms]![form_form1]![cboProjectName]
))
ORDER BY Participant.NameLast, Participant.NameFirst;

When I run the form the parameter dialog pops up. What is the correct syntax
so it retrieves the value from cboProjectName.Value?

Thanks
 
N

new2access123 via AccessMonster.com

Found a solution I just used cboProjectName.Value not a full path.
How to reference a control value in a row source query?

I have two combo boxes on a form the value of cboA I want to use in the row
source SELECT of cboB. In the query designer for the row source of cboB I
have entered for the WHERE clause:

=[Forms]![form_form1]![cboProjectName]

I have left the Access default form names

The actual SELECT from the SQL View is

SELECT ProjectToParticipant.ProjectID, Participant.NameLast, Participant.
NameFirst, Participant.NameMiddle
FROM Participant INNER JOIN ProjectToParticipant ON Participant.ParticipantID
= ProjectToParticipant.ParticipantID
WHERE (((ProjectToParticipant.ProjectID)=[Forms]![form_form1]![cboProjectName]
))
ORDER BY Participant.NameLast, Participant.NameFirst;

When I run the form the parameter dialog pops up. What is the correct syntax
so it retrieves the value from cboProjectName.Value?

Thanks
 

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