[RESOLVED] Keeping same id number Ms Access

Hi All

I have written a little sample program to show you my problem (see attachment) and all works well but I have one problem...

I would like the ChildId, TeacherId and SubjectId numbers to always match but I have no idea how as they are three auto numbers from three tables and spread over three forms

Any Advice?
[344 byte] By [bubble_girl] at [2007-11-20 10:09:44]
# 1 Re: [RESOLVED] Keeping same id number Ms Access
Without looking at your code, that sounds like a bad idea. Why not just create your own number for each, or use one main id for all?
dglienna at 2007-11-9 19:35:43 >
# 2 Re: [RESOLVED] Keeping same id number Ms Access
Because I'm trying to figure out how I'm going to pull the data in my 'next stage'

In some cases not all the tables will have have data in the rows so on one occasion I might only fill out the data in two tables and on another the data in all three tables also I might delete a row in one table but not the others

But I need the data to match up line by line so I can say for example row 3 in each table have the same id so all from the same entry therefore pull up the details

Rather that row 1 in two of the tables and row 4 in other are all the same entry so pull the details <-- the program won't know this

Help I'm confusing myself :)

P.s When you said 'use one main id for all' how do I do this as all the id numbers are primary keys? and each one being in a different table? There are three tables
bubble_girl at 2007-11-9 19:36:38 >
# 3 Re: [RESOLVED] Keeping same id number Ms Access
This is what you expact.

better you need to keep your connection in a module. I didn't change that here, I just change the db auto number field to Number (long integer) and and write some code to findout the next record number then add to each table while you press next.

I don't know this is a good way or not, but I normally did in this way.
check the commence.
pragashan at 2007-11-9 19:37:42 >
# 4 Re: [RESOLVED] Keeping same id number Ms Access
Thankyou

That is just what I was trying to do but couldn't get my head around it and ended up confusing myself even more :)
bubble_girl at 2007-11-9 19:38:43 >
# 5 Re: [RESOLVED] Keeping same id number Ms Access
You must consider onething here, when you delete record.

If you delete last record from the child table. the next id of the child record not supported to other table. becouse there already have this record id.

here better you can do is check all the three table and find out the last largest number and choose that is the next id for all.

Otherwise you'll get db duplication error.
pragashan at 2007-11-9 19:39:42 >