I have a Table called Resource Allocation that pairs an employee name with a job, and stores how much they work as well as a value called headcount. I'm trying to automate the value of the Headcount field (text) based on the Percent Utilization field (number) as well as some other information. My goal is to automate it in a large macro with some If statements.
I can't even get my first If statement to work properly though. Here's what I'm trying:
A Data Macro that triggers After Update - this way if the Percent Utilization is updated manually in the table or through the input form it will automatically recalculate the Headcount field for that line (and eventually others, but I'll ask for help on that later)
If [Percent Utilization]=100 Then -therefore, if 100%, then do the following
Edit Record
Alias -left blank so it edits the currently selected record
Set Field
Name Resource Allocation.Headcount - the name of the field to edit
Value = "True" - enters a text value of True
End EditRecord
End If
I can't get it to work at all. If I edit anything in the Percent Utilization field nothing changes, and Refresh doesn't do anything either. I also tried this as a Named Macro, then called it in another Macro so that I knew it would run. Still no dice.
I have very little macro experience, but I've read most of the chapters on Macros in Access 2010: The Missing Manual. Let me know what I'm doing wrong, and thanks!