KB 210194 doesn't work

D

Darren Boyer

This article doesn't work!

I keep getting an error at the
If Err <>0 Then Resume
when compiled.

I get Error 3265 in the form the article designs.

Here is my code:
Function Next_Custom_Counter()

On Error GoTo Next_Custom_Counter_Err

Dim rs As Recordset
Dim NextCounter As Long

Set rs = CurrentDb.OpenRecordset("CounterTable",
dbOpenDynaset, dbSeeChanges)

NextCounter = rs!NextAvailableCounter

rs.Edit
rs!NextAvailableCounter = NextCounter + 10
NextCounter = rs!NextAvailableCounter
rs.Update

MsgBox "Next Available Counter is " & Str(NextCounter)

rs.Close

Set rs = Nothing

Next_Custom_Counter = NextCounter

Exit Function

Next_Custom_Counter_Err:

MsgBox "Error " & Err & ": " & Error$
If Err <> 0 Then Resume
End

End Function

Any suggestions?
 

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