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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving forms

Status
Not open for further replies.

quackslikeaduck

Technical User
Apr 16, 2013
46
US
Can anyone help me figure out why when I close my form and it save to the tables it always overwrites the last save which is the first in my table. I believe each should save in a new row.

My tables are as such:

TblPurchaseOrder (a table holding information on items being ordered)
ProductCodeNum (primary key, number)
LastName (text field)
FirstName (text field)
To (text field)
Address (text field)
City_State_ZIP (text field)
DeptNum (number field)
ProductCodeNum (number field)
RequestedBy (text field)
DateRequired (Date/Time)
HowShip Terms (text field)
Date (Date/Time)
PO# (number field)
Total (currency field)

tblPurchaseOrderItems I'M THINKING THAT THIS TABLE IS NOT JOINED RIGHT
ID (Primary Key, autonumber)
ProductCodeNum (number field)
QuantityOrdered (number field)
TotalInventory (number field)
QuantityReceived(number field)
RequestedItems (number field)
PricePerUnit (number field)
TotalInventory (number field)
QuantityReceived(number field)

tblItemList
ID (Primary Key, auto number)
ProductCodeNum
Description
$$/unit Supplier
UOM

tblSupplierList I'M THINKING THIS TABLE IS NOT JOINED RIGHT
ID (Primary Key, auto number)
ProductCodeNum
SupplierName (text field)
Address (text field)
City/State (text field)

Right now I have the following joins:


tblPurchaseOrderNumber.ProductCodeNum related to tblItemList.ProductCodeNum in one to many enforce referential Integrity Cascade update related fields

tblPurchaseOrder.ProductCodeNum related to tblPurchaseOrderItem.ProductCodeNum in one to many enforce referential Integrity Cascade update related fields

tblPurchaseOrder.ProductCodeNum related to tblSupplierList.ProductCodeNum in one to many enforce referential Integrity Cascade update related fields

THIS JOIN SEEMS FINE
tblItemList.ID related to tblPurchaseOrderItem.ProductCodeNum in one to many enforce referential Integrity Cascade update related fields
 
I think you need to learn the basics of Access. Typically a form will open and display the "first" record. Anything you enter into bound controls will update the "first" record. If you want to create a new record, you need to create a new record.

Duane
Hook'D on Access
MS Access MVP
 
It was overwriting the first row because the primary key was not autonumber and therefore wasn't creating a new row.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top