|
-
Dec 3rd, 1999, 02:39 AM
#1
Thread Starter
Member
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??
-
Dec 3rd, 1999, 03:23 AM
#2
Thread Starter
Member
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.
-
Dec 3rd, 1999, 03:27 AM
#3
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
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 3rd, 1999, 03:34 AM
#4
Thread Starter
Member
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?
-
Dec 3rd, 1999, 03:53 AM
#5
Hyperactive Member
Try something like this:
Code:
Private Sub Data1_Reposition()
StatusBar1.Panels(1).Text = Data1.Recordset.AbsolutePosition
End Sub
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470 Add Me ICQ Me
AIM: TomY10
PERL, JavaScript and VB Programmer
-
Dec 3rd, 1999, 04:05 AM
#6
Thread Starter
Member
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!!!!!!!!!!!!!!!!!!!!!!
-
Dec 3rd, 1999, 04:09 AM
#7
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
[email protected]
[email protected]
-
Dec 3rd, 1999, 04:17 AM
#8
Thread Starter
Member
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!!!!!!!!!!!!!!!!
-
Dec 3rd, 1999, 04:53 AM
#9
Thread Starter
Member
Can Anybody help me??????????????
-
Dec 3rd, 1999, 06:13 AM
#10
Nope, you were not moving to the next record.
Try this:
Code:
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
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 3rd, 1999, 12:28 PM
#11
Thread Starter
Member
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?
-
Dec 3rd, 1999, 12:39 PM
#12
New Member
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
-
Dec 4th, 1999, 12:34 PM
#13
Member
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.
-
Dec 4th, 1999, 12:54 PM
#14
Hyperactive Member
Anita!
Did you make it work?
-
Dec 5th, 1999, 10:28 PM
#15
Thread Starter
Member
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.
-
Dec 6th, 1999, 12:08 PM
#16
Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|