Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7497537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:08:08+00:00 2026-05-29T19:08:08+00:00

I have four tables each with its own form, all these table share same

  • 0

I have four tables each with its own form, all these table share same column which is the unique id. How do i update other tables when i add new row in one form at same time, that is how do i get a row in other tables with unique id and other columns being empty?

Is there a way to specify more than one control source to the unique id field?

I tried the approach in making one to one relationships between unique id in one table to other tables unique ids But this did not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:08:14+00:00Added an answer on May 29, 2026 at 7:08 pm

    You could execute INSERT statements from the form’s before or after insert events. If your form has a text box named txtID bound to the ID field in the form’s record source:

    Private Sub Form_AfterInsert()
    Dim db As DAO.Database
    Set db = CurrentDb
    db.Execute "INSERT INTO Table2 (ID) VALUES (" & Me.txtID & ");", dbFailOnError
    db.Execute "INSERT INTO Table3 (ID) VALUES (" & Me.txtID & ");", dbFailOnError
    db.Execute "INSERT INTO Table4 (ID) VALUES (" & Me.txtID & ");", dbFailOnError
    Set db = Nothing
    End Sub
    

    That approach assumes all the fields in those tables other than the ID fields will accept Null values (in table design view, the Required property is No).

    But it might be better to do this from the before insert event, and cancel the INSERT for the current form if any of the other inserts fail. And in that case you may also want to roll back any of those other inserts which succeeded — this could easily get more complicated.

    Edit: I gave you a very rough outline. Now that you’re getting the too few parameters message, suggest you revise it along these lines so you can view the exact INSERT statements you’re asking the db engine to execute.

    Private Sub Form_AfterInsert()
    Dim db As DAO.Database
    Dim strSql As String
    Set db = CurrentDb
    strSql = "INSERT INTO Table2 (ID) VALUES (" & Me.txtID & ");"
    Debug.Print strSql
    db.Execute strSql, dbFailOnError
    strSql = "INSERT INTO Table3 (ID) VALUES (" & Me.txtID & ");"
    Debug.Print strSql
    db.Execute strSql, dbFailOnError
    strSql = "INSERT INTO Table4 (ID) VALUES (" & Me.txtID & ");"
    Debug.Print strSql
    db.Execute strSql, dbFailOnError
    Set db = Nothing
    End Sub
    

    You can view the output from those Debug.Print statements in the Immediate window. (You can get to the Immediate window with Ctrl+g) You can also test any of those statements by copying it from the Immediate window and then pasting it into SQL View of a new query.

    Edit2: If Record_Num is text (such as R98609) rather than numeric data type, add quotes around the values when you build the INSERT statements.

    strSql = "INSERT INTO Table2 (ID) VALUES ('" & Me.txtID & "');"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a secondhand sale car database and four tables with relationships. Same column
So I have four tables. Each table has a single id for the previous
I have four tables containing exactly the same columns, and want to create a
I have four classes which share some arrangement of four properties. I have currently
I have a table of four columns. The data in the first column is
I have two tables: groups and group_members . The groups table contains all the
Ok, I have four tables: Table 1: f_withholdings Table 2: f_wh_list Table 3: f_rpayments
I currently have four different servers all with many databases on them. Each server
I have four tables: Users PrivilegeGroups rdPrivileges LinkPrivilege ----------- ---------------- --------------- --------------- userId(pk) privilegeGroupId(pk)
Let's say I have four tables: PAGE , USER , TAG , and PAGE-TAG

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.