Question about text boxes

  • Thread starter Thread starter Spidey3721
  • Start date Start date
S

Spidey3721

Wondering how far I can go with text boxes. I have two tables:

tblProject
ProjectID
Projectname

tblCost
CostID
amount

I then have a query that includes ProjectID, CostID, and amount; with amount
being a SUM, grouped by ProjectID - this gives me the sum of all costID's
specific to each project.

Then I have a form with a ProjectID textbox.

I want to add a text box that shows the sum of all costs for the ProjectID
from that textbox (like the query mentioned above) - I can set the
ControlSource of this textbox to the query, but how do I tie it into the
ProjectID text box so that it shows the sum that I want. Do I need to add a
subform for this. If so, can I hide the borders and the record navigator
buttons?

I also guess that I can base the whole form on the query, but there is more
than just these items on the form and it seems like I would run into other
problems .... I don't think I understand the basic strategy of how to manage
form record sources...
 
You could set the textbox to an expression using DSum, but it's going to be
slow. What about linking your "sum" query to the table to create a second
query, and use _that_ as the record source for your form?

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
Back
Top