mc7560
asked on
dmax error
Experts, All of the fields following me. are txt fields in my form, based on which the vba runs off of. When I run the code, I get an error message.
dhrsleft = IIf((DMax(Me.hdev, Me.ddev) - Me.dev) > 0, (DMax(Me.hdev, Me.ddev) - Me.dev), 0)
I am trying to determine the maximum value between hdev & ddev and use that to calculate the variance between that and dev. For example:
if hdev = 10, ddev= 15 and dev= 10 then I want the dhrsleft = max(10,15)-10 = 5
Please help/
dhrsleft = IIf((DMax(Me.hdev, Me.ddev) - Me.dev) > 0, (DMax(Me.hdev, Me.ddev) - Me.dev), 0)
I am trying to determine the maximum value between hdev & ddev and use that to calculate the variance between that and dev. For example:
if hdev = 10, ddev= 15 and dev= 10 then I want the dhrsleft = max(10,15)-10 = 5
Please help/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do not accept this as a solution.
Public Function MyMax(var1, var2)
MyMax = IIF(var1 > var2, var1, var2)
End Function
In your query/report
=MyMax(hdev, ddev)
Public Function MyMax(var1, var2)
MyMax = IIF(var1 > var2, var1, var2)
End Function
In your query/report
=MyMax(hdev, ddev)
ASKER