Use combo box selection to calculate text box (1 Viewer)

dmcfarland9

New member
Local time
Today, 14:29
Joined
Jul 23, 2018
Messages
6
Hi all. I am trying to track attrition at work. So, I have a form created with 2 combo boxes, one for month and one for year. I need a text box to calculate sum(Termsforthemonth)/sum(EmployeesAtEOM), based on the year and month selected in the combo boxes.

I hope I explained that well enough. Please help!
 

Mark_

Longboard on the internet
Local time
Today, 11:29
Joined
Sep 12, 2017
Messages
2,111
Depending on how you are storing data/what you are using in your combos, it could be as simple as

DSUM( "Field", "Table", "FieldNameForDateOfTermination >= " & DateSerial(CboYear,CboMonth,1) & " FieldNameForDateOfTermination <= " & DateSerial(CboYear,CboMonth + 1,0) )

You can try this and see if it is close to what you are looking for. You will need to make sure on formats, control names, and verify what is returned from your comboboxes in the first place though. Since I don't know how you are populating the comboboxes or what type of variable you are holding the field you want to filter on, this is about the best "Air code" I can think of to demonstrate one way of getting what you are after.

Another would be doing about the same with a query to return the values you are looking for.
 

dmcfarland9

New member
Local time
Today, 14:29
Joined
Jul 23, 2018
Messages
6
So I have the two combo boxes set up like the attached. One to select a year and one to select a month. When a year is selected (without a month selected), I would like to be able to see just the yearly attrition percentage. When a month and a year are selected, I would like to see the monthly and yearly corresponding attrition percentages.
 

Attachments

  • Form.pdf
    10.9 KB · Views: 58

Users who are viewing this thread

Top Bottom