Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Status Bar Text - How to in VBA?

Status
Not open for further replies.

LJtechnical

Technical User
Aug 7, 2002
90
GB
Hi

I need to display a message in the status bar saying something like end of record set when the user tries reaches the end of rcd set. I have played with the echo method but to no avail can any one help. This is what i have:

Dim rcd As Recordset
Set rcd = Me.RecordsetClone
If Me.CurrentRecord < rcd.RecordCount Then
DoCmd.GoToRecord , , acNext
Else
DoCmd.Echo True, &quot;End of Records.&quot;

Beep

End If
 
Paste this in a code module:
[blue]
Code:
Option Explicit
Dim x As Long

Sub TestStatusBar()
  x = x + 1
  Application.StatusBar = &quot;Processing &quot; & x
End Sub

Sub ClearStatusBar()
  Application.StatusBar = False
End Sub
[/color]

Have the bottom of the Excel workspace visible, then run TestStatusBar a few times. When satisfied, run ClearStatusBar.

(Easy way to run: Place cursor over the code between the Sub and End Sub and press F5.)
 
Hi,

Depends on how obvious you want your alert message. I usually code a message box :-

intSequenceno = Me.Region_Number + intAdd
Set rsdetails = myDB.OpenRecordset(&quot;SELECT * FROM [Details] _ WHERE [region_order] = &quot; & intSequenceno & &quot;&quot;)

If rsdetails.RecordCount = 0 Then
strReply = MsgBox(&quot;No Further Records&quot;, vbOKOnly, &quot;Attention&quot;) = vbOK
GoTo endsub
Else
rsdetails.MoveFirst
Me.Alpha_number = rsdetails!Alpha_Order
Me.Region_Number = intSequenceno
Me.site_id = rsdetails!site_id
End If
 
Hi,
Sounds like you're in Access.

Check HELP. There's not only StatusBarText but also SysCmd

Here's an example right out of HELP

Forms(&quot;Mailing List&quot;).Controls(&quot;Address_TextBox&quot;). _
StatusBarText = &quot;Enter the company's mailing address.&quot;



Skip,
Skip@TheOfficeExperts.com
 
Sorry, I missed that you were in Access. Application.StatusBar is for Excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top