I have a main form frmIFFertStocks and subform FrmIfSfFertStocks linked by master/child field FarmAccountNumber.
On the main form I have an unbound combobox called cbCroppingYear.
I use the combobox to select the cropping year and this updates the data in the subform using the following query
The form is great at displaying existing records but if I try and add a new record via the form then the CroppingYear is not added to the underlying table.
Is it possible to use code to grab the value of croppingYear from the combobox and use it when a new record is added?
Also if there are any suggestions on streamlining the query or forms then please say.
Thank you for any help
Neil
On the main form I have an unbound combobox called cbCroppingYear.
I use the combobox to select the cropping year and this updates the data in the subform using the following query
Code:
SELECT tblfertstocks.FertStocksIndex, tblfertstocks.CroppingYear, tblfertstocks.FarmAccountNumber, tblfertstocks.ProductIndex, tblfertstocks.Stocks, tblfertstocks.Purchases, tblfertstocks.StockComment, tblfertstocks.Cost, tblfertstocks.PurchaseComment
FROM tblfertstocks
WHERE (((tblfertstocks.CroppingYear)=[forms]![frmIfFertStocks]![cbcroppingyear]));
The form is great at displaying existing records but if I try and add a new record via the form then the CroppingYear is not added to the underlying table.
Is it possible to use code to grab the value of croppingYear from the combobox and use it when a new record is added?
Also if there are any suggestions on streamlining the query or forms then please say.
Thank you for any help
Neil