ControlSource for a Textbox ???

D

David

Can my ControlSource for a Textbox be a query that takes a
parameter and returnd just a sum value. My query is:

SELECT sum(Activity.ActivityHours)
FROM ChangeRequest, Assignment, Activity
WHERE ChangeRequest.ID = Assignment.ChangeRequestID and
Assignment.ID = Activity.AssignmentID AND ChangeRequest.ID
= [Parm_ID];

How would I code the ControlSource? The Parm_ID value is
in another textbox on the same form.
 
R

Rick Brandt

David said:
Can my ControlSource for a Textbox be a query that takes a
parameter and returnd just a sum value. My query is:

SELECT sum(Activity.ActivityHours)
FROM ChangeRequest, Assignment, Activity
WHERE ChangeRequest.ID = Assignment.ChangeRequestID and
Assignment.ID = Activity.AssignmentID AND ChangeRequest.ID
= [Parm_ID];

How would I code the ControlSource? The Parm_ID value is
in another textbox on the same form.

Use DLookup() function pointed at your query. TextBoxes can't look at queries
directly.
 

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