|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Hi,
I have an app with a parent-child form and I need to generate the keys of the 2 tables in th following way: Parent IdP:1 IdP:2 IdP:3 Child IdP:1 IdC:1 IdP:1 IdC:2 IdP:1 IdC:3 IdP:2 IdC:1 IdP:2 IdC:2 IdP:3 IdC:1 IdP:3 IdC:2 Note that for each parent record it is necesary to enumerate its child records from 1. I think I could generate the child key from a query similar to this: select max(IdC) from ParentTable where IdP = X. How can I do this in ms-access. I think it is a very basic problem but I haven't found the way to solve it in access please help me. If you need more details about the app just let me know. Thanks a lot |
|
#2
|
||||
|
||||
|
could you please explain why it is necessary to enumerate child records from 1
if it were me i would use an autonumber for the child table keys should never be visible to users of the application, so it doesn't really matter that autonumbers for children of different parent records all are drawn from the same sequence rudy http://r937.com/ |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > ParentChild key |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|