PDA

Click to See Complete Forum and Search --> : Status Bar.


Anita
Dec 3rd, 1999, 01:39 AM
Here is the code I have written in the Got_focus event of the first text box.
Dim pnl As Panel
With Sbr1.Panels(1).Text = "Record" & rs!Index
.AutoSize = sbrSpring
.Style = sbrText
End With
Set pnl = Sbr1.Panels.Add
pnl.Style = sbrCaps
pnl.AutoSize = sbrContents
Set pnl = Sbr1.Panels.Add
pnl.Style = sbrNum
pnl.AutoSize = sbrContents
Set pnl = Sbr1.Panels.Add
pnl.Style = sbrIns
pnl.AutoSize = sbrContents
Set pnl = Sbr1.Panels.Add
pnl.Style = sbrDate
pnl.AutoSize = sbrContents
Set pnl = Sbr1.Panels.Add
pnl.Style = sbrTime
pnl.AutoSize = sbrContents
It is not working!!!
Where is the mistake??

Anita
Dec 3rd, 1999, 02:23 AM
rs!index is not working.Please help.
How do I display the no. of the current record in a recorset in the status bar when the user is moving from one record to another.

Serge
Dec 3rd, 1999, 02:27 AM
You should use AbsolutePosition property of the Recordset object.

so, when you move through the recordset you would use:


StatusBar1.Panels(1).Text = rs.AbsolutePosition


------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

Anita
Dec 3rd, 1999, 02:34 AM
Thanks for your reply.It is displaying record no1 for the first time but when the user clicking the next button or previous button it is not updating the status bar.How do you do that?

Compwiz
Dec 3rd, 1999, 02:53 AM
Try something like this:


Private Sub Data1_Reposition()
StatusBar1.Panels(1).Text = Data1.Recordset.AbsolutePosition
End Sub


------------------
Tom Young, 14 Year Old
tyoung@stny.rr.com
ICQ: 15743470 (http://wwp.icq.com/15743470) Add Me (http://wwp.icq.com/scripts/search.dll?to=15743470) ICQ Me (http://wwp.icq.com/scripts/contact.dll?msgto=15743470)
AIM: TomY10 (http://www.aol.com/aim/aim30.html)
PERL, JavaScript and VB Programmer

Anita
Dec 3rd, 1999, 03:05 AM
How do I update the statusbar with the current record when the user is moving from one record to another in a recordset????
Please help!!!!!!!!!!!!!!!!!!!!!!

Aaron Young
Dec 3rd, 1999, 03:09 AM
You need to recall the Code Snippet Serge Posted Each Time you Move within the Recordset, ie. In your Next and Previous Command Buttons.

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

Anita
Dec 3rd, 1999, 03:17 AM
In the command button
Next
previous
last
first
I have written
sbr_1.Panels(1).Text = "Record" & rs.AbsolutePosition & "of" & rs.RecordCount

But still it is not updating!!!!!!!!!!!!!!!!

Anita
Dec 3rd, 1999, 03:53 AM
Can Anybody help me??????????????

Serge
Dec 3rd, 1999, 05:13 AM
Nope, you were not moving to the next record.
Try this:


Private Sub cmdNext_Click()
If rs.EOF Then Exit Sub
rs.MoveNext
sbr_1.Panels(1).Text = "Record" & rs.AbsolutePosition & "of" & rs.RecordCount
End Sub

Private Sub cmdPrevious_Click()
If rs.BOF Then Exit Sub
rs.MovePrevious
sbr_1.Panels(1).Text = "Record" & rs.AbsolutePosition & "of" & rs.RecordCount
End Sub


Assuming that you have 2 command buttons cmdNext and cmdPrevious

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

Anita
Dec 3rd, 1999, 11:28 AM
When the user is moving from one record to another, I want to display in the status bar which is the current record like 'Showing reocrd no 8'.How do I do that?

vboric
Dec 3rd, 1999, 11:39 AM
Use the folowing approch.
{texbox GotFocus()}--Where this is your function when you give the focus to your controls on the screen. remember that to do for each
statusbar1.panels(1).text= rs!index

second way is to index your controls an instgat of the recordset!index to pas the control Index to the statusbar.

Regards Vladimir

Gerald
Dec 4th, 1999, 11:34 AM
Anita,

If you're using an ADO recordset or ADO data control, you will need to be sure your recordset's cursor location is set to adUseClient in order to use AbsolutePostion. BTW, the cursor location must set before the recordset is opened--it cannot be changed after it has been opened.

Good luck, Gerald M.

LG
Dec 4th, 1999, 11:54 AM
Anita!
Did you make it work?

Anita
Dec 5th, 1999, 09:28 PM
Thanks.
The aduseclient is working fine.
But is it true that
If the CursorLocation property is set to adUseClient, the recordset will be accessible as read-only.
But for me it is working, I can delete and save records???
Please Clarify.

Gerald
Dec 6th, 1999, 11:08 AM
Anita,

You should be able to edit your data with a client side cursor. However, if your record source is comprised of joined tables, then there will be some problems with updating and deleting when using a client side cursor. Apparently there is not enough "key information" for the database provider to complete updates when using a client cursor. If your record source is a single table, then you should be OK.

I wish I could speak more authoritatively on the subject or at least direct you to some documentation, but I've searched high and low for some without much success.

Gerald M.