Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2012
    Posts
    56

    Unanswered: form subform array problem

    Hello I have a table stored in an array 4 fields 30 records I want to insert this in a linked table in a subform I am trying to use the on load event where i am using code to get my array populated.

    The goal is to open a main form to a new record which i will manually fill in. The subform has a table with 8 fields of whick I want to fill 4 of fields with appox 30 records.

    current situation I have lost my way so any help would be great.

    thanks Bob

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    So you're loading records from a table into an array, then you want to copy them back to another table? Why not just use an append query to copy the records directly?
    Paul

  3. #3
    Join Date
    Oct 2012
    Posts
    56

    I need to clarify

    Thanks for the imput but I need to clariy.

    the form with subform has two tables Shift_Main and Shift Detail they are linked on fields Shift_ID to get a one to many relationship ie.Pkey &Fkey
    I want to open both tables so I get a linked record in each table. before I enter any data I want to populate the detail table with three of the eight fieldswith and fill in manually the balance of the data data. The Table i want to imput from is created with a make table query with several different criteria.

    Hope this is clear enough and once again thanks for the help.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I still don't see the point of the array. You can just append the records from one table to the other. I don't know if you're doing something similar, but I have a db to track driver activity. We have a variety of rates they might charge during the day, kept in a rate table. For data entry, I append a record for every possible rate into the activity table, so the user can just tab through and assign hours to the applicable rate(s). When the user exits the form, I delete any record with 0 hours.
    Paul

  5. #5
    Join Date
    Oct 2012
    Posts
    56

    more clarity required

    Hello paul thats the idea I am trying to do except my table shift_main has several other tables that are related. so need to keep the relationships. I have to tell you I am a novice at this and manage to get things done by reading on the net. I do have a couple of books coming on VBA so I can learn more. So the question I have when are you doing the append query in the form module on an open table? if so can you help with a little direction on the code.
    Thanks Bob

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    In my case they are first on a form that populates the "main" table, then they open a popup form to enter rates. When they click on the button to open that form I run the append query, which uses the first form to get the foreign key value. You could also do it with a subform, running the append and then requerying the subform.
    Paul

  7. #7
    Join Date
    Oct 2012
    Posts
    56
    Hi would be interest in the details of how to do that

    Thanks Bob

  8. #8
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    How to do what, exactly?
    Paul

  9. #9
    Join Date
    Oct 2012
    Posts
    56

    need more help (just a learner)

    uses the first form to get the foreign key value. would that be in vba in one of the form or subform events. How would I do that?
    __________________

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •