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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write to status line of the window

Status
Not open for further replies.

tfstom

Programmer
Sep 28, 2002
190
US
How do you write to the status line of a window?

I want to be able to write the record number to the bottom of the window as it is reading through it.

Thanks,

Tom
 
If you are using the regular Microsoft Windows Common Controls statusbar then alls you have to do is

StatusBar1.Panels.Item(1).Text = "record number"



and you just change the x to the panel number if you have more than one panel in the status bar

StatusBar1.Panels.Item(X).Text = "record number"

%, 2004
dweidner@ctelcom.net
 
Percent,
I think tfstom wants the actual record number to print on the status bar and not the words "record number".

tfstom,
I suppose that would depend on what method your using to read your records.
 
To get the record number you need to update the status bar within the loop where you read the records. You will need counter to keep track of which record number that you are currently reading.

You can also add the total number of records to be read. This is optional but will give the user more feedback.

Also if your status bar has only one panel you can use this syntax.

Code:
Status1.SimpleText=?

for multiple panels this will also work.

Code:
Status1.Panels(x).text=?

Below is an example.

Code:
do until rs.EOF
  i=i+1
  Status1.Panels(x) = "Reading record " & i & " of " & rs.recordcount & "."
  ...
loop

Check the rs.recordcount value as it may be off by one. If so make the adjustment.

zemp
 
I know what he ment by record number - I just put that in the text field to make it easier for him to understand

I assumed he knew how to access the record information - and just needed help with the status bar - that is what it seemed like to me

%, 2004
 
Also I wouldn't use a loop I think that would be to much just to update the status bar - I would put the status bar code in an event - for example if you are using the data control to access a database the - I beleive it is something like
Code:
Private Sub Data1_RecordChange()
'Put Status Code Here
End Sub
^Not entirely sure if this correct I don't have VB in front of me

If you would like help with the record information - just post what controls you are using - or the type of data source you are using

%, 2004
 
I am actually going to be doing this in ActiveX (using VB) in DTS on SQL Server. I already have the record number and just want to display it on the Status bar of the main window.

How do I define StatusBar1 (above example) in my code to use it. I assume I would have to Dim it and then do something like a CreateObject to assign it?

Tom
 

A statusbar is a control that you can add to your form...

Are you actually talking about the windows taskbar? You know where the start button is?

Good Luck

 
taskbar.jpg

statusbar.gif


Which one did you want to know how to use?

%, 2004
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top