I have a for for making orders called NordersMaken with a subform NordersDetails. Here is some info on my tables:
tblOrders (=form NordersMaken)
OrderId
OrderDate
Seller
Customer
...
tblOrderDetails (= Form NordersDetails)
OrderDetailId
OrderId
ProductId (from tblProducts)
BlowerId (from tblBlowers)
Price
...
tblProducts
ProductId
Ref
Serial
Avail (yes/no) /for item ordered = not available (value yes/true)
uit (yes/no) / for item invoiced = out of wharehouse (value yes/true)
tblBlowers
BlowerId
Type
Serial
Available (yes/no) /for item ordered = not available (value yes/true)
out (yes/no) / for item invoiced = out of wharehouse (value yes/true)
From the form Products(tblProducts) I send the ProductId intot he subform, NordersDetails and set the focus on the main form (NordersMaken) with this:
The problem: when I try to change details in the subform (NordersMaken) like Price I get an error message saying that the JETDB couldn't find the record OrderDetails.BlowerId. Just because I didn't select it. what if I don't need/want to? How could I leave it blank and/or avoid those errors?
tblOrders (=form NordersMaken)
OrderId
OrderDate
Seller
Customer
...
tblOrderDetails (= Form NordersDetails)
OrderDetailId
OrderId
ProductId (from tblProducts)
BlowerId (from tblBlowers)
Price
...
tblProducts
ProductId
Ref
Serial
Avail (yes/no) /for item ordered = not available (value yes/true)
uit (yes/no) / for item invoiced = out of wharehouse (value yes/true)
tblBlowers
BlowerId
Type
Serial
Available (yes/no) /for item ordered = not available (value yes/true)
out (yes/no) / for item invoiced = out of wharehouse (value yes/true)
From the form Products(tblProducts) I send the ProductId intot he subform, NordersDetails and set the focus on the main form (NordersMaken) with this:
Code:
DoCmd.OpenForm stDocName, , , , acFormAdd
Forms!NordersMaken.Form!OrderDatectrl = Date
Forms!NordersMaken.NordersDetails.Form!Serial = Me.ProductId