PDA

Click to See Complete Forum and Search --> : Relation between two tables in Access DB


nileshhthakur2004
Mar 30th, 2006, 12:46 AM
Hi all, :bigyello:

i have two tables in my DB Order and OrderItems

in Order User enter there Order and it contain one primaryKey filed
OrderID which is AutoGenrated Number in Ordertable
Now in OrderItems table i have number of column with OrderItemNbr and OrderID fileds here OrderID is my ForeignKey filed so after entering data in both table it will show you data as follows,

Table Name : ---

Order
=========

OrderID | OrderDate | ShipToLocationID
----------------------------------------------------
1 | 01/03/2004 | 2
---------------------------------------------------
2 | 02/04/2005 | 12
---------------------------------------------------
3 | 04/04/2005 | 13
---------------------------------------------------
4 | 11/12/2005 | 16
---------------------------------------------------

OrderItems
=========

OrderID | OrderItemNbr | ---
-------------------------------------------
1 | 1 |
-------------------------------------------
1 | 2 |
-------------------------------------------
2 | 1 |
-------------------------------------------
2 | 2 |
-------------------------------------------
2 | 3 |
-------------------------------------------
3 | 1 |
-------------------------------------------

now i use this two table on my Access Form

i bind this parent form to third table (othere than Order and OrderItem table) and place two subforms on this Parent form one subform for Order and other for OrderItem, as my OrderItemNbr are not autogenrated fields so user need to enter this number each time is this posible that user enter the OrderID = 2 and any how we look in table the max OrdreItemNbr for OrderID = 2 and assign the Max number + 2 for that OrderID (2 in this case)
??

i hope you understand my question and reqirements also ...

if not pls let me know

pls help me regarding this ...

thanx and reagrds

KGComputers
Mar 30th, 2006, 10:40 PM
Hi,

What is the third table as source for the third subform?

:) :) :)