Results 1 to 6 of 6
  1. #1
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69

    Question Getting a strainge error message

    Hi,
    First I am runing this on MS Access 2007 on a Win7(64 bit) machine, but I ran this on an XP machine(32 bit) and got the smae thing. The error I ma getting is: "you tried to a ssign the NUll value to a varible the is not a Variant data type". How ever I am not assiging to an variables and every field in both tables is data type text. And all I am doing is runing this update query to update the fields in one table to the fields in anothr table. I even tryed doing a part at a time and on any part of this I get the same thing. I ran this yesterday with different fields and had no problem.
    Here is the query:


    Code:
    UPDATE [Copy Of dbo_APVEN] INNER JOIN [ADDRESS UPDATE] ON [Copy Of dbo_APVEN].VENDORID=[ADDRESS UPDATE].VENDORID
    SET [Copy Of dbo_APVEN].[TEXTSTRE1] = [ADDRESS UPDATE].[TEXTSTRE1], [Copy Of dbo_APVEN].[TEXTSTRE2] = [ADDRESS UPDATE].[TEXTSTRE2],
    [Copy Of dbo_APVEN].[TEXTSTRE3] = [ADDRESS UPDATE].[TEXTSTRE3],[Copy Of dbo_APVEN].[TEXTSTRE4] = [ADDRESS UPDATE].[TEXTSTRE4],
    [Copy Of dbo_APVEN].[NAMECITY] = [ADDRESS UPDATE].[NAMECITY],[Copy Of dbo_APVEN].[CODESTTE] = [ADDRESS UPDATE].[CODESTTE],
    [Copy Of dbo_APVEN].[CODEPSTL] = [ADDRESS UPDATE].[CODEPSTL],[Copy Of dbo_APVEN].[IDGRP] = [ADDRESS UPDATE].[IDGRP];
    Any ideas I would really appreciate.
    Thank you
    Last edited by itm; 02-17-2012 at 08:43 AM. Reason: add code tags an fix Title

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Check the properties of the field in the table you are updating ([Copy Of dbo_APVEN]). If Required=Yes, and the corresponding field in [ADDRESS UPDATE] is null, then that is most likely that cause of the error. Try changing the Required property of all the text fields in [Copy Of dbo_APVEN] to No.

    John

  3. #3
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Hi thanks for your help, but I did looked at this and you are right they are set to requiered. So, I set them all to not requiered, just to see waht woud happen and I got the same thing.

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I suspect the problem may not be in the SQL statement. Can you post the the code you are using this statement in, or is this the SQL of a query which fails when you try to run the query?

    John

  5. #5
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    It is not code, the query that I have above is just that a query. I just created this update query and ran it in the query tool. Now, again I did one just like it with didfferent filed the night before and it worked.

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Strange - I don't any reason why it would not work, especially since the error message refers to variables. Try a compact-and-repair (make a backup copy first!) to see if that helps.

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Message Box
    By dr223 in forum Access
    Replies: 11
    Last Post: 01-12-2012, 11:59 AM
  2. Message Box
    By JayX in forum Access
    Replies: 6
    Last Post: 12-13-2011, 02:28 PM
  3. Help with message box
    By Cablenm in forum Access
    Replies: 9
    Last Post: 10-14-2011, 05:06 PM
  4. Message Box
    By dunnmel4 in forum Programming
    Replies: 9
    Last Post: 04-12-2011, 10:44 PM
  5. message box help
    By shaz10010 in forum Forms
    Replies: 1
    Last Post: 04-17-2009, 09:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums