Answered by:
Text Box to Contain Calculations

Question
-
Here's my newbie Access developer question o' the day.
I have a form where I want to display stats about a table. I'm going to start off with:
Minimum Date Created
Maximum Date Creted
# of Records
So I have those three labels on the form, each with a text box to the right of it. I want to use calculations or queries or something to fill the text box with the most up to date info.
Need help.
tod
Tuesday, November 24, 2015 9:19 PM
Answers
-
Tod
Access has domain aggregate functions that do lots of things like that. The functions have 3 parts:
1. the field
2. the table/query
3. the criteria (WHERE clause without the word WHERE)
So to find the number of records all you do is use one as the ControlSource:
=DCount("*","myTable","FiscalYear='2015'")
Be sure to use an equal sign in frontof it. Check help for the other functions like DMax, DMin.
Bill Mosca
www.thatlldoit.com
http://tech.groups.yahoo.com/group/MS_Access_Professionals- Edited by Bill Mosca, MS MVP 2006-2016 Tuesday, November 24, 2015 9:39 PM
- Marked as answer by todtown Tuesday, November 24, 2015 9:41 PM
Tuesday, November 24, 2015 9:30 PM
All replies
-
Tod
Access has domain aggregate functions that do lots of things like that. The functions have 3 parts:
1. the field
2. the table/query
3. the criteria (WHERE clause without the word WHERE)
So to find the number of records all you do is use one as the ControlSource:
=DCount("*","myTable","FiscalYear='2015'")
Be sure to use an equal sign in frontof it. Check help for the other functions like DMax, DMin.
Bill Mosca
www.thatlldoit.com
http://tech.groups.yahoo.com/group/MS_Access_Professionals- Edited by Bill Mosca, MS MVP 2006-2016 Tuesday, November 24, 2015 9:39 PM
- Marked as answer by todtown Tuesday, November 24, 2015 9:41 PM
Tuesday, November 24, 2015 9:30 PM -
Perfect. Easy, huh?
While I'm sort of on the subject, when I add a text box to the form it also adds the Text44 or whatever to the left of it. I don't want that. How do I delete it.
tod
Tuesday, November 24, 2015 9:43 PM -
Oh wait. I figured it out. You just highlight it and delete it.
Tuesday, November 24, 2015 10:02 PM -
Perfect. Easy, huh?
While I'm sort of on the subject, when I add a text box to the form it also adds the Text44 or whatever to the left of it. I don't want that. How do I delete it.
tod
Bill Mosca
www.thatlldoit.com
http://tech.groups.yahoo.com/group/MS_Access_ProfessionalsWednesday, November 25, 2015 9:25 PM