Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box to use value from Query

Status
Not open for further replies.

mlocurci

MIS
Oct 17, 2001
210
US
I have a form that's main job is to create an evaluation. One of the tabs on the form is a summary of the evaluation. It totals the score from each tab of the evaluation. I used to have scoring done as an event procedure, but the scoring was getting tricky since I needed it to update always based on changes. I then thought the best way to handle it was to creating a query that has became my scoring engine. What I need to do now is put the values from my query into the textbox on the same form as the evaluation. I am having trouble doing this and was hoping someone can tell me what to do or if there is a better way to handle this.
 
Can't you just refer the query as the source of your form?

If u need more then one query, just add other querys to the source?

I don't quite get your problem....
 
The form writes to the table, the query only contains a subset of the fields in the table. I only want to call this query for the purpose of calculating numbers. I want my textbox to look to the query for the value while at the same time refering to the form.
 
Docmd.open acquery, "query name"

That will run your query that calculates, then you need to run an update query that will update your table

UPDATE TableName
SET ColumnYouWantToChange = ColumnYouWAntInYourQuery
WHERE COlumn#2 = QueryColumn#2

The WHERE being the condition, The SET being the column you want to change.

If yyou ever would want not to have the Warnings, just put the line.

DoCmd.SetWarning = false
 
You may consider one of the Domain aggregate functions: DLookUp, DSum, DCount, ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry my post wasnt really relevent, I probably misread, dlookup is what your are probably looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top