You tried to assign the Null value to a variable that is not a variant data type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hannoudw
    New Member
    • Aug 2010
    • 115

    You tried to assign the Null value to a variable that is not a variant data type

    Hi. I'm working with a form that contain text boxes ( Invoice_num auto number, and Invoice_date bound to the table Invoice) , and a subform contains (num (and it's an auto number also) , article, size, qty, price,....)

    and here is the SQL of the subform:
    Code:
    Code:
    SELECT purchase.purchase_num, purchase.Invoice_num, purchase.article, purchase.size, purchase.quantity, item.Price, item.Price_after_discount, purchase.unit_price, purchase.Difference, item.st_q1, item.st_q2, item.st_q3, item.st_q4, item.st_q5, item.st_q6, item.st_q7, item.st_q8, item.st_q9, item.st_q10, [item solderie].st_q1,[item solderie].st_q2, [item solderie].st_q3, [item solderie].st_q4,        [item solderie].st_q5, [item solderie].st_q6, 
    [item solderie].st_q7, [item solderie].st_q8, 
    [item solderie].st_q9, [item solderie].st_q10, item.Stock, [item solderie].Stock, Invoice.total_cash, Invoice.total_diff, Invoice.total_discount
    FROM item INNER JOIN ([item solderie] INNER JOIN (Invoice INNER JOIN purchase ON Invoice.Invoice_num= purchase.Invoice_num) ON [item solderie].Article = purchase.Article) ON item.Article = purchase.Article;
    But everytime that i try to add the article in the subform i got this error:
    You tried to assign the Null value to a variable that is not a variant data type".
    After that i press ok i can continue with the form , i insert the size and everything work fine afer that, till i want to fill the quantity , it gives me that error:
    The Microsoft Office Access database engine cannot find a record in the table 'Invoice' with key matching 'Invoice_num'

    but i was working on that form before , and it was working , but i needed to do some updates , and these errors pop up , but i tried to add some data on an Invoice Number that i had created before i did the update everything works fine ! and i was surprised and i don't know why i can't create a new Invoice number and how can i fix this?
    Hope some one help me . thanks guys for reading this.
Working...