Function in Update To

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
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top