Results 1 to 7 of 7

Thread: Object doesn't support property or method

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75
    I am getting a baffling error in a program I am working on. It is not the error itself but when it is occurring.

    The error I am getting is “Object doesn’t support property or method.” And I get an OK or Help option….If I press OK the program continues on normally.

    It is not a run-time error that can be debugged or even trapped it seems to be a VB error. The problem is it happens at random times and in no set pattern…when I break into code (ctrl-break) all the objects are set to valid properties and are using valid methods. I am at a loss.

    Is there anyway to suppress this message? I have tried on error resume next statements to no avail….any suggestions?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    everything has a reason...
    is it small enough to post code?
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    This happened to me once also. I forgot to set a reference to the Objetc Model I wanted to use. At least thats what I think... I set the reference and it worked without the error, but I did'nt fully understand the error so am not 100% sure that sorted it or some other 'hack' sorted it.

    I am a poor programmer and sometimes change more than 1 thing at a time

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75
    OK I found the line that is giving me trouble...it in in one of my classes that I am using to control a database interface screen.

    the line is
    Code:
    If mvarTotalRecords > 0 Then
        mvardataCtl.Recordset.AbsolutePosition = mvarSliderBar.Value - 1
        updateButtons
    End If
    mvardatacontrol is a Data object
    mvarSliderBar is a Slider

    both are set on Form_load to their respective objects.

    UpdateButtons is a proceedure in the class to handle the enabling and disabling of buttons.

    The strange thing is the error doesnt always happen....this proceedure is called by moving or clicking on the sliderbar and only happens at random times.

  5. #5

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    msgbox "mvardataCtl.Recordset.AbsolutePosition"
    msgbox "mvarSliderBar.Value - 1"

    or debug...see which one has the problem.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    U.S.A.
    Posts
    75
    Yep I tried doing that and every single time I get the error both values of mvardataCtl.Recordset.AbsolutePosition and mvarSliderBar.Value - 1 are valid.

    And the objects are valid as well. Going to have a look elsewhere...guess I will comment out all code till I find the offending line.

    Thanks all for the help....if you can think of anything else or you had this error before and know how to fix it please let me know...thanks

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