Subform combobox

J

jhess85

I have a form for my table called Activity and a subform where users can
select other activities to link one activity to another in a table called
Activity2PostActivity. My row source for the combo box that I am using is:

SELECT Activity.ActivityID, Activity.ActivityName, Activity.ActivityCode,
Activity.ServiceAreaID FROM Activity ORDER BY [ServiceAreaID], [ActivityName];

What I need to now is to restrict the user from being able to select the
current activity in the main form as the PostActivity in the subform. I'm
thinking that i can somehow add a where statement to the end of the row
source of the combo box to do this. Something like:

WHERE Activity.ActivityID != [Current].ActivityID;

Something like that. Suggestions?
 
C

Carl Rapson

jhess85 said:
I have a form for my table called Activity and a subform where users can
select other activities to link one activity to another in a table called
Activity2PostActivity. My row source for the combo box that I am using
is:

SELECT Activity.ActivityID, Activity.ActivityName, Activity.ActivityCode,
Activity.ServiceAreaID FROM Activity ORDER BY [ServiceAreaID],
[ActivityName];

What I need to now is to restrict the user from being able to select the
current activity in the main form as the PostActivity in the subform. I'm
thinking that i can somehow add a where statement to the end of the row
source of the combo box to do this. Something like:

WHERE Activity.ActivityID != [Current].ActivityID;

Something like that. Suggestions?

Try referring to the ActivityID in the Parent form as follows:

...WHERE Activity.ActivityID <> " & Parent.ActivityID

Carl Rapson
 

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