• add new record in another form

    • This topic has 2 replies, 2 voices, and was last updated 24 years ago.
    Author
    Topic
    #356181

    i have one form that i have information that the user enters in. i would like to take bits and pieces of this information and enter it into different tables…
    let me explain:
    i have a main form with EmpID, EmpDept, and BldgNo (and several others, but these will do to keep it simple). i also have two tables: one with EmpID and EmpDept, as well as one with EmpID and BldgNo. these two tables are for linking purposes. how can i input the info on the main form to the corresponding fields (as new records) in the two other tables?
    thanks for any help

    Viewing 0 reply threads
    Author
    Replies
    • #526645

      Two options:

      1) build recordsets in code based on each of the table you want to write to and use the .AddNew method (DAO) to populate the appropriate fields

      2) call a saved query and pass it parameters or create SQL in code and execute it to write the records.

      • #526646

        thanks charlotte
        what i have tried, and it looks like it might work is:
        when i hit the OK button on the main form, it opens each of the other forms (which are data-entry for each of the tables) with visible set to NO, and enters the data, then closes the form and goes to the next one. seems to work pretty well. thanks for your time

    Viewing 0 reply threads
    Reply To: add new record in another form

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: