Results 1 to 8 of 8

Thread: Error 438 (A3K)

  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 438 (A3K)

    I'm getting the old "Object doesn't support this property or method" for the following code in Access 2003

    Private Sub Form_Current()
    If Me.NewRecord Then
    Me!lblRecCount.Caption = "New"
    Else
    Me.RecordsetClone.Bookmark = Me.Bookmark
    Me!lblRecCount.Caption = "RecNo. " & CStr(Me.RecordsetClone.AbsolutePosition + 1) _
    & " of " & CStr(Me.RecordsetClone.RecordCount)
    End If
    ' The Following Lines stops the User from going before the first record
    If Me.CurrentRecord = Me.RecordsetClone.RecordCount Then
    Me![butGoNext].Enabled = False
    Else
    Me![butGoNext].Enabled = True
    End If
    ' The Following Lines stops the User from going past the last record
    If Me.CurrentRecord = 1 Then
    Me![butGoPrevious].Enabled = False
    Else
    Me![butGoPrevious].Enabled = True
    End If

    End Sub

    It needless to say worked in previous versions. What am I missing this time?

    As always, thanks in advance for help,
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 438 (A3K)

    It would help if you told us on which line of the code you get this error.

    BTW I don't have Access 3000 yet <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 438 (A3K)

    Sorry about that Hans,

    It highlighted:

    Me!lblRecCount.Caption = "RecNo. " & CStr(Me.RecordsetClone.AbsolutePosition + 1) _
    & " of " & CStr(Me.RecordsetClone.RecordCount)

    Hope this helps,
    Cheers,
    Andy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 438 (A3K)

    Does it work better if you use

    Me!lblRecCount.Caption = "RecNo. " & Me.CurrentRecord _
    & " of " & CStr(Me.RecordsetClone.RecordCount)

  5. #5
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 438 (A3K)

    Hans,

    It give me the same message with the new lines highlighted and also "greys" out ToolReference. I looked in there in case one of my references might have "come undone", but can't get to look at it.
    Cheers,
    Andy

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 438 (A3K)

    While code is paused (for example because of an error), Tools | References... will be disabled. You'll have to end code execution to look at references. Which ones are checked?

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> May I draw your attention to a nifty feature of Access forms: navigation buttons. If you display them (by setting the Navigation Buttons property of the form to Yes), Access will display First, Previous, Next, Last and New Record buttons, and a (record) n of m indication. All this without you having to write a single line of code! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  7. #7
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 438 (A3K)

    Hans,

    I think you've mentioned elsewhere if not to me about the Tool | References situation, but thanks for reminding me.

    Now, with respect to the nifty feature, you'll probably be surprised that, yes, I was aware of it. However, when you have a client that tells you that those "buttons at the bottom of your screen are really tiny" you try and find other means to satisfy their little cheque signing hearts, ergo, the tedious code.

    Now, are you sitting down. I went to one of my other forms which I remembered about after and discovered that the same code as my original posted version was working perfectly. So ......... I deleted said code in the non-working form, copied and pasted what appears to be exactly the same code from the working form ... and..
    it works. I'm not even go to bother trying to figure out why tonight.

    Thanks again Hans for your help,
    Cheers,
    Andy

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error 438 (A3K)

    Sometimes, VBA code gets corrupted. In some cases, you can get rid of it by deleting it and typing in exactly the same code, or as you did, paste a non-corrupt version of the code.

    You'll probably never know what the exact cause of the problem was, but what matters is that you've got it working again.

Posting Permissions

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