G
Guest
I am trying to get the default value for a field to be generated by a query.
The query uses the value "CustID" from an open form (CustDataForm) which is based on the "CustDataTable", and then finds the max value for "ItemID" in the "ItemDataTable" where the CustID's are equal... i.e. it returns the correct value for the max item number for the customer I'm currently working with.
The query works fine when I run it directly... but when I try to create a new "Item" record in the ItemDataTable using the ItemDataForm, the field for ItemID says #Name?...
As I enter data, it sets the field to zero rather than 2 (if there's already a record associated with that customer) or 1 (if it's the first item for that customer). Basically I just want the form to start counting from 1 and work it's way up (for each customer) without the autonumber function (so that the records are sequential). Any suggestions how to solve the #Name? problem?? thanks
The query uses the value "CustID" from an open form (CustDataForm) which is based on the "CustDataTable", and then finds the max value for "ItemID" in the "ItemDataTable" where the CustID's are equal... i.e. it returns the correct value for the max item number for the customer I'm currently working with.
The query works fine when I run it directly... but when I try to create a new "Item" record in the ItemDataTable using the ItemDataForm, the field for ItemID says #Name?...
As I enter data, it sets the field to zero rather than 2 (if there's already a record associated with that customer) or 1 (if it's the first item for that customer). Basically I just want the form to start counting from 1 and work it's way up (for each customer) without the autonumber function (so that the records are sequential). Any suggestions how to solve the #Name? problem?? thanks