Linking tables help?

crazycitten19

New member
Local time
Today, 07:48
Joined
Dec 11, 2009
Messages
2
I have a number of tables that different sets of information about a specific person, and I am having trouble linking the tables.
When I start a new record in one table, I want it to start a new record in all of the tables. The tables are linked by an unique ID number. How do I do it so it starts a new record in all of the tables instead of individually?

Many Thanks
 
I have a number of tables that different sets of information about a specific person, and I am having trouble linking the tables.
When I start a new record in one table, I want it to start a new record in all of the tables. The tables are linked by an unique ID number. How do I do it so it starts a new record in all of the tables instead of individually?

Many Thanks

Please clarify what you are trying to do with an example.
"When I start a new record in one table, I want it to start a new record in all of the tables." does not make any sense to me.
 
Please clarify what you are trying to do with an example.
"When I start a new record in one table, I want it to start a new record in all of the tables." does not make any sense to me.

I have attached a simple database that is similar to what I am trying to do.

Table 1 2 3 all contain different information, but there will be one record in each.

I am trying to link them so that when I start a new record in a form that has fields for all/some of the information I can enter it.

Hope this makes sense.
 

Attachments

this makes perfec sense

what i have done is have my numbering system from a system table then when i add a record the number comes from there -
don't rely on auto numbering - - its good for unquie numbers but thats about it

ok you have you number after it is generated
look at the code .add

I have used the number from my table (table name "systemtbl" - field name quoteno
then i have used this number to add into the compliance table so every record will have a line entered into the compliance table (note i have ripped this from another source so none of my own work)

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click


DoCmd.GoToRecord , , acNewRec

'OrganiserPolicynumber
Dim QuoteNo As Long
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT QuoteNo FROM systemtbl")
QuoteNo = rs!QuoteNo + 1
'now update the table
rs.Edit
rs!QuoteNo = QuoteNo
rs.Update
rs.Close
Set rs = Nothing

Me.QuoteNo = QuoteNo

Dim dbs As DAO.Database
Dim Complinacetbls As DAO.Recordset
Set dbs = CurrentDb
Set Complinacetbl = dbs.OpenRecordset("Complinacetbl")
With Complinacetbl
.AddNew
!QuoteNo = Me.QuoteNo

.Update
End With


Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom