So, I'm trying to calculate a Transfer % for call statistics.
Related Table Fields:
totalcalls (Number, Long Integer) - Total number of calls
totalxfers (Number, Long Integer) - Total number of transfers
xferpercent (Number, Double) - Transfer % (Format is set to Percentage and fixed to 1 decimal point)
There are also the same fields on the form.
Related VBA Code:
Me.totalcalls.Value = DCount("Type", "CallData Query", "[Date]= #" & entrydate & "#")
Me.totalxfers.Value = DCount("Type", "CallData Query", "[Transfer]= 'Y' AND [Date]= #" & entrydate & "#")
Me.xferpercent.Value = totalxfers / livecalls
When I do that and click the 'Calculate Stats' button, I get values in [totalcalls] and [totalxfers] but in [xferpercent] I get nothing. Blank. And no errors.
However, if I unbind the [totalxfers] text box and set it's ControlSource to =[totalxfers]/[livecalls] then VOILA! I get a percentage value in the box! Of course, it doesn't save a value to the record in the DailyStats table, which is what I need it to do.
Any suggestions on why Me.xferpercent.Value isn't working, but setting it as ControlSource is? Am I missing something stupidly simple?