I have a form that uses a query as the record source. This query is a parameterized select query that uses two tables. Table no 1 is used to display order information and can be written to or updated; the form is used for entering/updating orders. Table no 2 is used to obtain the customer name and address for informational purposes and is not updated.
The form that uses this query contains an unbound combobox in its header that allows the user to select customers from the customer file. Afer a customer has been selected the customers ID is moved to a bound textbox; that is used as the queries parameter, and a requery action is perfromed to allow the user to see all the orders the selected customer has made or enter a new order for that customer.
When ever the requery action is perfromed a new record is created using the default values for all the key fields except for the customer number, which contains the value selected by the user. Unless I delete this record from the file I am unable use the form again for this customer because I receive an attempt to write a duplicate record error.
Is there a property I can set or a programming technique I can use to keep the new record from being created.
The form that uses this query contains an unbound combobox in its header that allows the user to select customers from the customer file. Afer a customer has been selected the customers ID is moved to a bound textbox; that is used as the queries parameter, and a requery action is perfromed to allow the user to see all the orders the selected customer has made or enter a new order for that customer.
When ever the requery action is perfromed a new record is created using the default values for all the key fields except for the customer number, which contains the value selected by the user. Unless I delete this record from the file I am unable use the form again for this customer because I receive an attempt to write a duplicate record error.
Is there a property I can set or a programming technique I can use to keep the new record from being created.