[AccessD] Text in the Status Bar
Stuart McLachlan
stuart at lexacorp.com.pg
Fri May 26 00:02:21 CDT 2023
Note: According to
https://learn.microsoft.com/en-us/office/vba/api/access.application.syscmd
You can't set the status bar text to a zero-length string (""). If you want to remove
the existing text from the status bar, set the Text argument to a single space.
I no longer have 2010 but the following work for me on later versions.
Textboxes and some other controls that can get focus have a Status Bar Text property that
you can set and it is displayed only when the control has focus.
You can also update it with something like
Private Sub CustomerAddress_GotFocus()
If NZ(CustomerArress,"") = "" Then
CustomerAddress.StatusBarText = "Customer Address Required"
Else
CustomerAddress.StatusBarText = "Customer Address OK"
End if
End Sub
Alternatively, to leave the status bar set until something else resets it:
Private Sub CustContact_GotFocus()
Dim lret As Long
lret = SysCmd(acSysCmdClearStatus)
End Sub
Private Sub CustomerAddress_GotFocus()
Dim lret As Long
lret = SysCmd(acSysCmdSetStatus, "Now it's set")
End Sub
On 26 May 2023 at 15:20, Paul Wolstenholme wrote:
> Hi,
>
> I have an Access 2010 application running on client computers with
> various Access versions. In some instances I use VBA to set, and then
> later to clear, a status bar message:
>
> ' Set a status bar message
> SysCmd(acSysCmdSetStatus, "A message goes here")
>
> ' Clear any status bar message
> SysCmd(acSysCmdSetStatus, " ")
>
> From that point I would like the status bar to show the content of the
> status bar text property of the current form's current control.
>
> I've been seeing some unexpected results on Access 2016 during a site
> visit where detailed testing wasn't practical (the licence was Office
> Professional 2016). I don't have that version on my own computers. My
> research is showing some references to
>
> SysCmd(acSysCmdClearStatus)
>
> or
> SysCmd(acSysCmdSetStatus, " ")
> SysCmd(acSysCmdClearStatus)
>
> Does anyone know what command sequence can be relied upon to return
> the status bar to displaying the status bar text property on all
> Access versions (or at least >= 2010)?
>
> I've also seen Access 2016 showing a truncated version of the status
> bar text property. Can anyone please tell me how that might come
> about? There is no usage of the progress bar in the database so I
> hoping that isn't it.
>
> Paul Wolstenholme
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list