For the time being, I'm not using the extended MsgBox functionality on the most flickering usage.
If anybody has any idea why this happens when this particular form is being manipulated, please help. This is not normal flickering, the Access window is flashing and the menu keeps cycling between the normal menu and the Form Design menu.
Now there is a new issue.
I have a utility function which I've moved to the reference database. It is designed to display either a message or progress on the Status Bar. Here is the code:
Code:
Public Enum StatusBarTypeEnum
sbtNone = 0
sbtClearStatus = 1
sbtClearProgress = 2
sbtInitProgress = 3
sbtShowStatus = 4
sbtShowProgress = 5
End Enum
Public Enum AcSysCmdAction
acSysCmdInitMeter = 1
acSysCmdUpdateMeter = 2
acSysCmdRemoveMeter = 3
acSysCmdSetStatus = 4
acSysCmdClearStatus = 5
End Enum
Public Sub ShowStatusBar(action As StatusBarTypeEnum, Optional Message As String = "", Optional Value As Integer = 0, _
Optional pauseSeconds As Single = 0, Optional playBeep As Boolean = False)
Dim result As Variant
If playBeep Then Beep
If action = sbtNone Then
result = SysCmd(acSysCmdRemoveMeter)
result = SysCmd(acSysCmdClearStatus)
ElseIf action = sbtClearProgress Then
result = SysCmd(acSysCmdRemoveMeter)
ElseIf action = sbtClearStatus Then
result = SysCmd(acSysCmdClearStatus)
ElseIf action = sbtInitProgress Then
result = SysCmd(acSysCmdInitMeter, Message, Value)
ElseIf action = sbtShowStatus Then
result = SysCmd(acSysCmdSetStatus, Message)
ElseIf action = sbtShowProgress Then
result = SysCmd(acSysCmdUpdateMeter, Value)
End If
DoEvents
If pauseSeconds > 0 Then Pause pauseSeconds
End Sub
Here is how I use this in my code:
Code:
ShowStatusBar sbtInitProgress, "Creating emails...", 100, 2
recs = rs.RecordCount
rec = 0
' start my code loop here...
' do some code in the loop
rec = rec + 1
pct = recs \ rec
ShowStatusBar sbtShowProgress, , pct
' Next statement here...
' After end of loop, clear the status area
ShowStatusBar sbtNone
This has always worked for me, but now it's not. I'm wondering why running this code from the reference project is messing this up.
Maybe SysCmd works in the current (main) DB, but not from the reference DB?
Thanks...