Managing the MSACCESS Status Bar

W

WGHayes

Hi,

The status bar that appears in MSACCESS has a general text area (1st cell) that can be updated by SysCmd(acSysCmdSetStatus) etc.. It also shows CAPS, NUM, INS, SCRL etc.. for whatever your keyboard is current set. Ideally we would like to control this status bar programmatically so that we can add new Panels/Cells to include such things as FORM ID, VERSION and Date/Time etc..

Is this possible?

We have played with adding a MSACCESS Status Bar Control to the footer of each form (SbarCtrl) which works well and looks good however this is a form specific based solution. Using form specific status bars also means that we end up with two status bars visible, one for the form and one for MSACCESS (i.e. we really would like to keep the MSACCESS status bar visible at all times).

Ideally as a form gets focus (activate event) we would like to manage the MSACCESS status bar.

Thanks,
WGH.
 
T

Terry Kreft

If the built in SysCmd methods don't suit your purpose then you're lookingat
a bunch of API calls.

Usin the API you'll need to:-
Find the hwnd ofthe status bar
Add new windows to it using the createwindow api and setparent
Then control the text you put into the windows you've created.


Personally, unless there was some really pressing need I woul just go wih
SysCmd.



--

Terry Kreft


Hi,
The status bar that appears in MSACCESS has a general text area (1st cell)
that can be updated by SysCmd(acSysCmdSetStatus) etc.. It also shows CAPS,
NUM, INS, SCRL etc.. for whatever your keyboard is current set. Ideally we
would like to control this status bar programmatically so that we can add
new Panels/Cells to include such things as FORM ID, VERSION and Date/Time
etc..
Is this possible?
We have played with adding a MSACCESS Status Bar Control to the footer of
each form (SbarCtrl) which works well and looks good however this is a form
specific based solution. Using form specific status bars also means that we
end up with two status bars visible, one for the form and one for MSACCESS
(i.e. we really would like to keep the MSACCESS status bar visible at all
times).
Ideally as a form gets focus (activate event) we would like to manage the
MSACCESS status bar.
Thanks,
WGH.
 
T

Tom McNally

I've used following to create a versioning system on my MS Access title bar... Am sure you could do something else. tblAppProp contains my Version number and date etc.

Sub SetStartupProperties()
Dim strAppName As String
Dim strAppVer As String
Dim dtmApp As Date
Dim rstApp As DAO.Recordset

'sets global startup properties of db

On Error GoTo HandleErr
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
Set rstApp = CurrentDb.OpenRecordset("tblAppProp", dbOpenSnapshot)
With rstApp
.MoveFirst
strAppName = .Fields(0)
strAppVer = .Fields(1)
dtmApp = .Fields(2)
.Close
End With

ChangeProperty "StartupForm", DB_Text, "frmMain"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AppTitle", dbText, strAppName & " ver. " & strAppVer & " (upd: " & Format(dtmApp, "mm/dd/yyyy") & ")"
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
RefreshTitleBar

ExitHere:
Set rstApp = Nothing
Exit Sub

HandleErr:
Select Case Err.Number
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Miscellaneous.SetStartupProperties" 'ErrorHandler:$$N=Miscellaneous.SetStartupProperties
End Select
' End Error handling block.
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

Hi,

The status bar that appears in MSACCESS has a general text area (1st cell) that can be updated by SysCmd(acSysCmdSetStatus) etc.. It also shows CAPS, NUM, INS, SCRL etc.. for whatever your keyboard is current set. Ideally we would like to control this status bar programmatically so that we can add new Panels/Cells to include such things as FORM ID, VERSION and Date/Time etc..

Is this possible?

We have played with adding a MSACCESS Status Bar Control to the footer of each form (SbarCtrl) which works well and looks good however this is a form specific based solution. Using form specific status bars also means that we end up with two status bars visible, one for the form and one for MSACCESS (i.e. we really would like to keep the MSACCESS status bar visible at all times).

Ideally as a form gets focus (activate event) we would like to manage the MSACCESS status bar.

Thanks,
WGH.
 
D

david epsom dot com dot au

Hi,
The status bar that appears in MSACCESS has a general text area (1st cell)
that can be
by SysCmd(acSysCmdSetStatus) etc.. It also shows CAPS, NUM, INS, SCRL etc..
for whatever

etc??

FLTR,,,CAPS,,NUM,SCRL

Do you know any others?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top