ControlSource for a Textbox ???

  • Thread starter Thread starter David
  • Start date Start date
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.
 
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.
 
Back
Top