evanscamman
Registered User.
- Local time
- Yesterday, 19:41
- Joined
- Feb 25, 2007
- Messages
- 274
This is really weird. I've been using this little function for years with no problem. It generates a message box where the first sentence is in bolt type (similar to the built in MS Access messages.)
It has always worked until today. Now (and only in one case on one form), it will generate the message but then VBA abruptly aborts. No further code is run after that point - it doesn't even finish the procedure.
No results are returned.
I don't think the eval statement itself is the problem, because it works in every other instance. In fact, the same statement that calls the CustomMsgBox routine works just fine in another instance - the only thing that has changes from ine instance to the next is the value of the fields on the form.
I would post the rest of my code and form here, but there are so many subroutines that it would be totally confusing. I'm wondering can anybody shed some light on what would cause VB to stop code execution with no errors?
Thank you,
Evna
It has always worked until today. Now (and only in one case on one form), it will generate the message but then VBA abruptly aborts. No further code is run after that point - it doesn't even finish the procedure.
No results are returned.
Code:
Function CustomMsgBox(strBold As String, strMsg As String, intButton As Integer, strTitle As String) As Integer
On Error GoTo ErrLog
'For some reason Eval statement used with MsgBox will provide a line in bold text
CustomMsgBox = Eval("MsgBox ('" & strBold & "@" & strMsg & "@@'," & intButton & ",'" & strTitle & "')")
Exit Function
ErrLog:
Call ErrorLog(Err.Number, Err.Description, "modCommon.CustomMsgBox")
Resume Next
End Function
I don't think the eval statement itself is the problem, because it works in every other instance. In fact, the same statement that calls the CustomMsgBox routine works just fine in another instance - the only thing that has changes from ine instance to the next is the value of the fields on the form.
I would post the rest of my code and form here, but there are so many subroutines that it would be totally confusing. I'm wondering can anybody shed some light on what would cause VB to stop code execution with no errors?
Thank you,
Evna