none
Only getting one record from Form1 to Form 2 when there are four records in Form1. RRS feed

  • Question

  • I am having difficulty in getting multiple records from one form to another form.  I am only getting one record when there are four records.  Both forms are continuous with no filters nothing runs on open, load or current and one record that I get does update the record source table. Both Forms are opened without a “where” clause. Any help on this would be appreciated. Bob

    On Click of Close button  of Form1, the following are ran to open Form2 and set its textbox values:

    DoCmd.OpenForm "frmCustomerDepositPayTransactions", acNormal, "", "", , acNormal
        Forms!frmCustomerDepositPayTransactions!Text44 = Combo96
        Forms!frmCustomerDepositPayTransactions!PayeePayor = Vendor
        Forms!frmCustomerDepositPayTransactions!Text39 = Combo49
        Forms!frmCustomerDepositPayTransactions!Credit = Text89
        Forms!frmCustomerDepositPayTransactions!ConbinedCategory = "Customer Deposit"
        Forms!frmCustomerDepositPayTransactions!ID = ID

    • Edited by BobAubry Saturday, July 6, 2019 5:41 PM
    Saturday, July 6, 2019 4:44 PM

Answers

  • Thanks, Hans.  I spent four days trying to get it working so you help is much appreciated.  Bob
    • Marked as answer by BobAubry Sunday, July 7, 2019 9:16 PM
    Sunday, July 7, 2019 9:16 PM

All replies

  • Are both forms based on the same table?

    Do you want to update existing records or do you want to append records?


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Saturday, July 6, 2019 7:00 PM
  • They are separate tables.  It adds a new record(wish it was records) to existing records.
    • Edited by BobAubry Saturday, July 6, 2019 10:14 PM
    Saturday, July 6, 2019 9:52 PM
  • You could run code like this:

        CurrentDb.Execute "INSERT INTO [tblTarget] SELECT * FROM [tblSource]", dbFailOnError
        DoCmd.OpenForm "frmCustomerDepositPayTransactions"

    where tblSource is the record source of the current form, and tblTarget is the record source of frmCustomerDepositPayTransactions.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by BobAubry Sunday, July 7, 2019 9:14 PM
    • Unmarked as answer by BobAubry Sunday, July 7, 2019 9:14 PM
    Sunday, July 7, 2019 8:05 AM
  • Thanks, Hans.  I spent four days trying to get it working so you help is much appreciated.  Bob
    • Marked as answer by BobAubry Sunday, July 7, 2019 9:16 PM
    Sunday, July 7, 2019 9:16 PM