
Error: Undefined Function in Addin
Hi All,
Thanks for all the responses. I thought I'd save some keystrokes and make
one general post instead of replying to every post separately. :-)
I agree with Ken's analysis that the queries seem to be looking at the
CurrentDB during execution time, although why built in functions like Nz
won't work, is beyond me.
I ended up converting the couple of execute statements that were using
either custom or built in functions to good ol' DAO code and life's a tad
slower but otherwise grand. :-)
And also did a quick check with qualifying the function, but it didn't seem
to help.
As for the code replacement, this is it, with the original function
remaining the same.
Lastly, for those who wished to see the addin, well, please note that it's
still _very_ much in early beta at the moment and doesn't contain any docs.
etc, but here it is.
Thanks again.
-- Dev
< http://home.att.net/~dashish2/downloads/wzbackup.zip >
'****** code start ********
Sub sLogLastUpdateStamp(lngID As Long)
'DAO replacement for an Action query since
'functions in SQL statement generate an
'error from Add-ins
'
'Read the time all objects in CurrentDB were last updated
'
On Error GoTo ErrHandler
Dim strSQL As String
Dim dbCurr As Database
Dim rsCurr As Recordset
Set dbCurr = CodeDb
'Which objects we need to look up?
strSQL = "Select LastUpdated, ObjectType, ObjectName From " _
& "tblObjects Where DBID = " & lngID
Set rsCurr = dbCurr.OpenRecordset(strSQL, dbOpenDynaset)
With rsCurr
If .RecordCount > 0 Then
Do While Not .EOF
.Edit
'Get the LastUpdated stamp from the container
!LastUpdated = fGetLastUpdateStamp(!ObjectType, _
!ObjectName)
.Update
.MoveNext
Loop
End If
End With
ExitHere:
Set rsCurr = Nothing
Set dbCurr = Nothing
Exit Sub
ErrHandler:
MsgBox Err.Description & " (" & Err.Number & ")", vbCritical,
"sLogLastUpdateStamp"
Resume ExitHere
End Sub
'********** Code End ***********
-- Dev