Howlsta
Vampire Slayer
- Local time
- Today, 01:22
- Joined
- Jul 18, 2001
- Messages
- 180
Hi there,
I am creating an orders database type thing and am struggling with updating info in a subform.
I have three tables in my database one for customers, one for orders (which has fields OrderID and furniture category) and one for customer orders.
In my form I am displaying the customer information in the main part of the form i.e. Name, address etc.
In the subform I am including their order history. I also want to be able to add new orders and this is the problem.
The subform simply shows date and furniture category. If I enter furniture category it creates a new record in the orders table. I don't want it to do this because I have five furniture categories and if I specify "bed" as the furniture category it creates a new record in the orders table. I want the furniture category to correspond to the order number. The order number will be a bit meaningless to the user you see.
So, I only want to add a new record in the customer orders table. This table contains the foreign keys OrderID, CustomerID and also the date. At the moment it is adding the record in this table, but is putting in a new orderID rather than an existing one.
I'm sure I've done this before but not for a couple of years. If I haven't explained very well please ask. I think it is just that the query on which the subform is based needs amending.
I am creating an orders database type thing and am struggling with updating info in a subform.
I have three tables in my database one for customers, one for orders (which has fields OrderID and furniture category) and one for customer orders.
In my form I am displaying the customer information in the main part of the form i.e. Name, address etc.
In the subform I am including their order history. I also want to be able to add new orders and this is the problem.
The subform simply shows date and furniture category. If I enter furniture category it creates a new record in the orders table. I don't want it to do this because I have five furniture categories and if I specify "bed" as the furniture category it creates a new record in the orders table. I want the furniture category to correspond to the order number. The order number will be a bit meaningless to the user you see.
So, I only want to add a new record in the customer orders table. This table contains the foreign keys OrderID, CustomerID and also the date. At the moment it is adding the record in this table, but is putting in a new orderID rather than an existing one.
I'm sure I've done this before but not for a couple of years. If I haven't explained very well please ask. I think it is just that the query on which the subform is based needs amending.