-
I keep trying to mess around with my Scrollbar Problem, which nobody seems to want to help me. :(
Anyways, I get error 3251, operation isn't supported for this type of object, but after reading up on the old developers network, I reckon that the absolute position is my best bet. I get the error when using this code:
Private Sub scrData_Change()
datVocab.Recordset.AbsolutePosition = scrData.Value
End Sub
ANY help would be much appreciated. :)
------------------
Tommy Boy.
-
I didn't see the old problem, so I'm stabbing in the dark here.
My question is: Have you set the Max and Min properties, with min=0 and max=NumberOfRecords?
With SmallChange=1, it should at least step properly.
--Carl
-
Thanks for the help, but I have actually done that, I've populated the recordset by moving to the last record using 'recordset.movelast' and yet I still get this error. :(
The min and max values I know are set correctly and still the small change doesn't work. > :(
------------------
Tommy Boy.
-
Well, you were a bit fague here and didn't post any code. What type of Data Objects are you using?
If what you're trying to achieve is Navigating a Recordset via a Scrollbar, try this:
Code:
Private oDB As Database
Private oRS As Recordset
Private Sub Form_Load()
Set oDB = OpenDatabase("BIBLIO.MDB")
Set oRS = oDB.OpenRecordset("Authors", dbOpenTable)
HScroll1.Max = oRS.RecordCount
HScroll1.Min = 1
HScroll1.LargeChange = HScroll1.Max / 100
HScroll1.SmallChange = 1
HScroll1_Change
End Sub
Private Sub Form_Unload(Cancel As Integer)
oRS.Close
oDB.Close
Set oRS = Nothing
Set oDB = Nothing
End Sub
Private Sub HScroll1_Change()
Static lLastVal As Long
If lLastVal = 0 Then lLastVal = 1
If (HScroll1 - lLastVal) <> 0 Then
oRS.Move (HScroll1 - lLastVal)
lLastVal = HScroll1
End If
Text1 = oRS("Author")
Caption = HScroll1
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert
-
THANKS HEAPS,
Your code did the trick, I just adjusted it slightly.
THANKS AGAIN :)
------------------
Tommy Boy.