Hi,
I have a simple invoice system in my database. Here are the main data sources:
tblSTOCK: StockID, Stock_Description, QTY_in_Stock
tblINVOICE: InvoiceID, CustomerID, Date
tblINVOICE_DETAILS: InvoiceID, StockID, QTY_Ordered
Simply put, when the user selects a QTY_Ordered amount (which is in a subform) and initiates an event to process the invoice (e.g. click of a command button or close form) a macro is invoked which runs an update query to update the new level in stock.
I've tried to use an if statement to avoid entering in more stock than available, here is what i tried:This doesn't work however. Can the DB not access the QTY_in_Stock field in tblStock?Code:[Forms]![fsubInvoice_Details]![QTY_Ordered]< [tblStock]![QTY_in_Stock]