Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39

    Unanswered: Code for multiple record entries?

    I have a form that is linked to a subform and the subform is based on
    a table's query.
    I'd like to put a textbox on the form and have the user enter a number
    in this text box. Then the user would enter a new record in the
    subform.

    What code could I use as an After update so that the number is taken
    from the Form's textbox and then that many identical records minus one
    (identical to the new record just inputted) are appended to the
    subform?

    So if number 3 is input, after the new record is entered, two new
    identical records are appended to the subform.
    If number 1 is input, then zero new identical records would be
    appended.

    Thanks very much! Eric

  2. #2
    Join Date
    Oct 2002
    Location
    NSW Australia
    Posts
    61
    Look up help on "Do while loop"

  3. #3
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39
    Hi Den,

    I looked up help on Do while loop but couldn't find any code examples of it. I used that paperclip guy and searched for Do while...

    Eric

  4. #4
    Join Date
    Oct 2002
    Location
    NSW Australia
    Posts
    61
    Msoft HELP example:

    Dim Counter, MyValue
    MyValue = [SomeTextBox]
    Counter = 0 ' Initialize variables.
    Do While Counter < MyValue ' Inner loop.
    Counter = Counter + 1 ' Increment Counter.
    docmd.openquery(your append query goes here)

    Loop



    Try something like this(you may have to fiddle a bit)

    :0)

Posting Permissions

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