Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am using Access 2002 sp3

    I have a class module named clsPersonInfo

    I have a subform named sfrmPerson

    I have a statement in the header of the subform:

    private c_person as clsPersonInfo

    In the ONLOAD event for the subform, I have the statement:

    set c_person = new clsPersonInfo

    In every situation, the instantiation does not occur and I get the error "invalid use of null".

    I have copied all objects to a new database, but same results

    Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Welcome to the Lounge!

    There is nothing wrong with your code in itself, so something must go wrong when creating a new instance of the class module. Do you have code in the Class_Initialize event procedure in the class module, and if so could the error be there?

  3. #3
    New Lounger
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, you are so right! There was a date field being initialized as null. Thanks for the help!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Great! I'm glad you were able to figure it out!

Posting Permissions

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