OK guys i'm struggling. I would class myself as somewhere between rookie and amateur at doing access databases but this current task i have set myself is making me wonder whether i'm more the former !!
I'm trying to setup a database that tracks the purchase of animal feeds for a farm. The structure of this i understand reasonably well and have used the Northwind Sample DB as a base for my new venture.
But...i am trying to go 1 step further by making this database a 'multi' farm affair.
So far i have created a form that loads at startup asking which farm is to be the active farm. This form saves a number to a table 'tblActiveFarm'. Nothing wrong with that.
I have also created the form 'frmFeedOrders' that starts by adding a new record to the table 'tblFeedOrders' which stores the active farm number. In the same form i have setup a products listbox that when double clicked should add a new purchase of 'feed' to the subform.
However, no matter what i have tried with relationships, primary/foreign keys i just can't seem to understand how to structure the database.
The error i seem to be getting most often (when double clicking the products listbox) is "You can't go to the specified record" (i notice when debugging that it happens with the DoCmd.GoToRecord,,acNew command).
I did think at one point i had succeeded using the Northwind DB as a structure. (ie OrderTable, ProductTable & OrderDetails table) but it would not let me have a duplicate product entry in the listbox
I am aiming for the subform to show ALL feed purchases AND allow me to add NEW feed purchases for the currently 'active farm'.
I have attached my cutdown DB and really would appreciate any assistance. I don't expect anyone to do it for me but if anyone could explain how to set it up (with regards primary/foreign keys) or tell me which fields need to be included in which table i would be hugely grateful.
I'm trying to setup a database that tracks the purchase of animal feeds for a farm. The structure of this i understand reasonably well and have used the Northwind Sample DB as a base for my new venture.
But...i am trying to go 1 step further by making this database a 'multi' farm affair.
So far i have created a form that loads at startup asking which farm is to be the active farm. This form saves a number to a table 'tblActiveFarm'. Nothing wrong with that.
I have also created the form 'frmFeedOrders' that starts by adding a new record to the table 'tblFeedOrders' which stores the active farm number. In the same form i have setup a products listbox that when double clicked should add a new purchase of 'feed' to the subform.
However, no matter what i have tried with relationships, primary/foreign keys i just can't seem to understand how to structure the database.
The error i seem to be getting most often (when double clicking the products listbox) is "You can't go to the specified record" (i notice when debugging that it happens with the DoCmd.GoToRecord,,acNew command).
I did think at one point i had succeeded using the Northwind DB as a structure. (ie OrderTable, ProductTable & OrderDetails table) but it would not let me have a duplicate product entry in the listbox
I am aiming for the subform to show ALL feed purchases AND allow me to add NEW feed purchases for the currently 'active farm'.
I have attached my cutdown DB and really would appreciate any assistance. I don't expect anyone to do it for me but if anyone could explain how to set it up (with regards primary/foreign keys) or tell me which fields need to be included in which table i would be hugely grateful.