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?
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?