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

Updating multiple tables from one forum

Status
Not open for further replies.

JTQ911

Technical User
Jul 26, 2007
2
US
I have just been given a new assignment and have never used access before. My database is most likely large, crude, and what you would expect from someone who has never used access before....

I have dozens of tables, each is a spec sheet for individual components that are part of a larger single unit. When a new unit is being built from scratch, its NAME and UNIT NUMBER is entered in a form. I have UNIT NUMBER as a column in every single one of my tables. How do I get the new UNIT NUMBER to be added to every single table when a new unit is entered in the form. Sorry, but I am the ultimate newb when it comes to access.
 
You might want to read -
Fundamentals of Relational Database Design

Can you trash your database and designed it correctly?

If not, the you can add code to your Save button such as:
This is an example of adding info to two tables. You would just copy the block of code for as many tables you have.

Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
Dim db As DAO.Database
Dim RS As DAO.Recordset

Set db = CurrentDb()
Set RS = db.OpenRecordset("Attendance", dbOpenDynaset)
RS.AddNew
RS![ID] = Me![ID]
RS![FirstName] = Me![FirstName]
RS![LastName] = Me![LastName]
RS.Update
RS.Close
db.Close
Set RS = Nothing
Set db = Nothing

Set db = CurrentDb()
Set RS = db.OpenRecordset("Bus Information", dbOpenDynaset)
RS.AddNew
RS![ID] = Me![ID]
RS![FirstName] = Me![FirstName]
RS![LastName] = Me![LastName]
RS.Update
RS.Close
db.Close
Set RS = Nothing
Set db = Nothing

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Save_Record_Click:
Exit Sub

Err_Save_Record_Click:
MsgBox Err.Description
Resume Exit_Save_Record_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top