Results 1 to 4 of 4
  1. #1
    spartanx117 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    3

    Form Entry (Enter a quanity of record)

    I have employees who enter into a database what types of activities they have been working on. Some activities can be done hundreds of times a day, and instead of having them enter the activity 100 times, is there a way I can add something to a form for the user to input a number(quanity) that will then add that number of records into the DB? Each record is defined wtih a auto number key, and the person's initials, current data and the activity.




    If I read 100 Emails, I would enter this 100 times, with the issueID inreasing each time I entered.

    IssueID 101
    JBC
    Read Email
    10/3/2013

    I would like to add a quantity selection so it will enter the inputting record x number of times when they click add record. Is this possible?


    Access 97 (This company doesn't keep up with times ^-^ ), currently using 1 table with ID field, initial field, date field, work completed field.

    Thanks!

    I also tried searching for someone else with a similar post, but was unsuccesful. If this has been answered, can you provide a link!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Use VBA procedure. Here is rough example.

    Dim i As Integer
    For i = 1 to Me.tbxLimit
    CurrentDb.Execute "INSERT INTO tablename(field1, field2, field3) VALUES('textvalue', #datevalue#, numbervalue)"
    Next

    For dynamic values, reference controls on form and concatenate.
    CurrentDb.Execute "INSERT INTO tablename(Initials, DateEnter, Activity) VALUES('" & Me.tbxInitials & "', #" & Me.tbxDate & "#, '" & Me.Activity & "')"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    spartanx117 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    3
    So I would have a field that would have this vba code assigned to it. It would take the numerical value the employee would insert, and put for I. So then for each I(lets say they put 100 in), it would Insert that many records?

    If that code isn't correct, I'm sure I can look around and fix it. I was looking around for a loop function, but it wasn't very clear on the ones I found.

    And thank you for a reply!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not a field, a button would have this code in its Click event VBA procedure.

    The real trick is making sure they don't accidentally click the button more than once and end up with too many records created.

    The For Next is a looping construct.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  2. Form auto enter field on new record click
    By Traceyann in forum Forms
    Replies: 3
    Last Post: 08-18-2012, 08:39 AM
  3. Replies: 4
    Last Post: 08-14-2012, 07:14 AM
  4. Replies: 6
    Last Post: 04-17-2012, 10:32 AM
  5. Replies: 1
    Last Post: 07-05-2011, 11:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums