Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get table to update!?

Status
Not open for further replies.

traceyc

Programmer
Jul 22, 2002
4
US
I have a customer-order form (customer table and order table with a one to many relationship, primary key = customerid): on the first form, the customer info is entered and assigned a customerid (autonumber). If you want to place an order, you click the order button - I'm able to carry the customerid to the second form but not update it in the orders table. How hard can it be? Would it be an event procedure, a query or requery, what?

Thanks in advance - TraceyC
 
Hi

In the Orders Table, you do have teh CustomeId as a type Number / LongInteger don't you, rather than an autonumber?, cos you cannot update an autonumber

Regards Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi

Have you saved the Customer Record?, if you have referential integrity on Client Table -> OrderTable, then you cannot insert Order until there is a matching record in Client Table.

Are you getting an error message?

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
No error message. I have to manually enter the customerid in the orders table field that's displayed on the form instead of it automatically being inserted. Make sense? There's also an order details table and that seems to take the orderid and oredered items just fine. I created those using the form wizard. I'm too far along to go back and redo the customer-order thing again.
 
traceyc,

Help me be clear about what is happeneing. The customer form being displayed has customer info. The form allows a customer to be added as well allows creating an order for the customer diplayed on the form (even if you just created a new customer). You want a new record in the orders table to be created when you click the order button, and the new order will have the current customer's customerid in some field in the orders table.

When you click the order button, what have you told it to do next? What creates the new order record and makes the orders form display in front? Is there code or a macro for that? Both you and KenReay mentioned not being able to update the orders table but you have not talked about how you created a new orders record or how the customerid was supposed to get into the right field in that record. Please tell us how that is happening.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top