R
Rhonda
Using Access 2002 VBA
I'm trying to post events in my program as they occur, using a list
box(named ev_log).
With:
(In Module1)
Public Function StatusOut(LogItem$, ByVal bLogFile As Boolean) As Boolean
Forms!frmTest.ev_log.AddItem LogItem$, 0
Forms!frmTest.ev_log.Selected(0) = True
If bLogFile Then
If bLogging Then
PrintString$ = LogItem$ & Chr(13) & Chr(10)
If bLogFileChgBusy = False Then
Err.Clear
Put #hLogFile, , PrintString$
If Err Then
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR -
Can't Save to Log File: " & Error$
Ret = StatusOut(LogItem$, 1)
bLogging = False
Err.Clear
bError = True
End If
End If
End If
End If
To post to the log from anywhere I use:
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR - Can't Save to Log
File: " & Error$
This works perfect in VB6, but in VBA It won't display anything.
A test:
Private Sub Command41_Click()
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR - Test Log Display "
End Sub
Any suggestions appreciated.
I'm trying to post events in my program as they occur, using a list
box(named ev_log).
With:
(In Module1)
Public Function StatusOut(LogItem$, ByVal bLogFile As Boolean) As Boolean
Forms!frmTest.ev_log.AddItem LogItem$, 0
Forms!frmTest.ev_log.Selected(0) = True
If bLogFile Then
If bLogging Then
PrintString$ = LogItem$ & Chr(13) & Chr(10)
If bLogFileChgBusy = False Then
Err.Clear
Put #hLogFile, , PrintString$
If Err Then
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR -
Can't Save to Log File: " & Error$
Ret = StatusOut(LogItem$, 1)
bLogging = False
Err.Clear
bError = True
End If
End If
End If
End If
To post to the log from anywhere I use:
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR - Can't Save to Log
File: " & Error$
This works perfect in VB6, but in VBA It won't display anything.
A test:
Private Sub Command41_Click()
LogItem$ = Format(Now, "m/d/yy h:mm AMPM") & ": ERROR - Test Log Display "
End Sub
Any suggestions appreciated.