Function in Update To

  • Thread starter Thread starter Edro
  • Start date Start date
E

Edro

Am I stupid???

Can I pass a function to the Update To in an update query?

I have a table whit a field to evauate against. Based on the value o
this field I want to update another field. In the Update To here is th
basic function idea:

AHT is a field to evaluate against.

Function Payout1(myval)

If AHT < 7.301 Then
myval = 80

If AHT > 7.39 And AHT < 8.01 Then
myval = 50

If AHT > 8.09 And AHT < 8.601 Then
myval = 25

If AHT > 8.69 Then
myval = 0

End If
End If
End If
End If

Debug.Print myval
End Function


Umph
 
Edro,

Try this...

Function Payout1(myval)
If myval < 7.301 Then
Payout1 = 80
ElseIf myval > 7.39 And myval < 8.01 Then
Payout1 = 50
ElseIf myval > 8.09 And myval < 8.601 Then
Payout1 = 25
ElseIf myval > 8.69 Then
Payout1 = 0
End If
End Function
 
Back
Top