Results 1 to 5 of 5

Thread: Error '3251', and this time, somebody please help me.

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Wanganui
    Posts
    11

    Post

    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.

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Southbridge, MA, USA
    Posts
    40

    Post

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Wanganui
    Posts
    11

    Post

    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.

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Wanganui
    Posts
    11

    Post

    THANKS HEAPS,

    Your code did the trick, I just adjusted it slightly.

    THANKS AGAIN

    ------------------
    Tommy Boy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width