Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Variant Data Error Message (2000)

    Hi,
    I have a form with a subform created and when I try to enter data into the subform I get the following message: "You tried to assign the Null value to a variable that is not a Variant data type". I can't figure out what this means. Help?
    Thanks,
    Deb

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

    Re: Variant Data Error Message (2000)

    Have you set the master and child linking fields correctly?

    Do you have code in the BeforeInsert event of the subform?

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variant Data Error Message (2000)

    Hans,
    Yes, I've checked the links and no there isn't any code. Do you think it's in my relationship between the 2 tables. I'm thinking I might have backwards. Part of my problem is I don't know what a Variable is and what a variant data type is.
    Thanks,
    Deb

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

    Re: Variant Data Error Message (2000)

    In Visual Basic (that's why I asked about code), variables can be of type Text, Numeric, Date, etc.:

    Dim strLastName As String
    Dim lngNumber As Long
    Dim dteBirthday As Date

    If you declare a variable as Variant (or omit the type), the actual type is determined at run time by the contents:

    Dim varSomething

    In these examples, lngNumber = Null is invalid, for you can't assign Null to a variable of type Long, but varSomething = Null is valid.

    You say that the relationship between the tables may be wrong, but you don't provide any details, so it's impossible to comment on that.

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variant Data Error Message (2000)

    Hans,
    I appreciate your responses. It was my relationships. I changed them around and everything is working fine. Thank you very much.

Posting Permissions

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