hi,
i'm trying to make an errmodule so i can see in a table when a user makes a fault other then 0.
i have this as err in each function:
and a module:
i'm trying to get the current control name (caption) to set in the tablecolumn "erronctrl". I tried alot in the function caller like:
But without any succes. Does anyone knows how to get the caption name (or function name) where the error occured.
thanks in advance
greetz
Vincent B.
i'm trying to make an errmodule so i can see in a table when a user makes a fault other then 0.
i have this as err in each function:
Code:
Call ErrorDB(me.caption)
Code:
Public Function ErrorDB(errctl As String)
Dim db As Database
Dim LSQL As String
Dim errnum As String
Dim errdesc As String
errnum = Err.Number
errdesc = Err.Description
If Err.Number <> 0 Then
Set db = CurrentDb()
LSQL = "insert into tblerrors (Gebruiker,errnummer,erromschrijving,erronForm,erronctrl) values ('" & NaamGebruiker & "','" & errnum & "','" & errdesc & "','" & CurrentObjectName & "','" & errctl & "')"
db.Execute LSQL, dbFailOnError
On Error GoTo 0
Set db = Nothing
MsgBox errdesc, vbCritical, errnum
End If
End Function
i'm trying to get the current control name (caption) to set in the tablecolumn "erronctrl". I tried alot in the function caller like:
Code:
Call ErrorDB(me.caption)
Code:
Call ErrorDB(ctl.caption)
Code:
Call ErrorDB(ctl.tag)
Code:
Call ErrorDB(ctl.controls.caption)
thanks in advance
greetz
Vincent B.