Compile errors in function when converting from 97 to 2000

J

Jacqueline

I am trying to convert an Access 97 mdb file to 2000...I
got a compile error and when I run the debugger it stops
at this function...
It highlights the last section...RankCheck = result
....error states...Function call on lefthand side of
assignment must return Variant or Object.

Any ideas on what it should be changed to?

Public Function RankCheckOrig(current_value As Integer) As
Integer
Dim previous_value As Integer
Dim previous_rank As Integer
Dim result As Integer
previous_value = Forms![Rankvariables]![previous_value]
previous_rank = Forms![Rankvariables]![previous_rank]
If current_value <> 0 Then
If (previous_value = current_value) Then
result = previous_rank
Else
previous_rank = previous_rank + 1
Forms![Rankvariables]![previous_value] =
current_value
Forms![Rankvariables]![previous_rank] = previous_rank
result = previous_rank
End If
Else
result = 0
End If

RankCheck = result
End Function
 
D

Douglas J. Steele

Looks as though you've copied the code from another function RankCheck, and
forgot to change the last line of the new function from

RankCheck = result

to

RankCheckOrig = result

I suspect you have RankCheck as a function in your application as well, and
that's what's causing that specific error message.
 
B

Bruce Loving

The function name is RankCheckOrig
change the last line to
Rankcheckorig = result
 

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