Results 1 to 9 of 9
  1. #1
    frikkie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    5

    Add "From" "to" data to table

    I am trying to create a trace database where i can record all stock received. My stock is only 1 item but with different unique serial numbers. So if i receive the stock from serial number 1 to 500 i want to capture the stock where each serial number is in its own row in the table. i want a form which a "from Number" and "to number" should pop up.I tried with queries, google code but cant find a method to do it.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Don't really follow what you mean by 'pop up'.

    If you want to 'capture' the stock then do data entry.

    Really need more info about the process you are trying to program.
    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
    frikkie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    5
    I want to capture the serial numbers with input on a form. Meaning if i receive the stock i will open a form and then enter start serial number as "1" and end serial number as "500" This will the update a table in the database with 500 rows of data with the actual serial numbers as the data in this 500 rows.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Requires VBA code writing records to table in a looping structure. Very simple example:

    Sub btnSave_Click()
    For x = Me.tbxStart To Me.tbxEnd
    CurrentDb.Execute "INSERT INTO tablename(SerialNum, DateEnter) VALUES(" & x & ", Date())"
    Next
    End Sub
    Last edited by June7; 01-20-2018 at 02:03 PM.
    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.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    missed a bracket

    VALUES(" & x & ", Date())"

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Thanks, Ajax. Corrected post.
    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.

  7. #7
    frikkie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    5
    Thank You. I did the code and go tthe following error "Method or data member not found" this error is for "tbxStart" in the code. I am still new in VBA code. Thanks for the help

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Use whatever you named your textboxes.
    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.

  9. #9
    frikkie is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    5
    Hi. Sorry my mistake. Got it working now. Thanks very much.

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

Similar Threads

  1. Replies: 13
    Last Post: 12-12-2016, 12:26 AM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 3
    Last Post: 02-16-2015, 01:04 PM
  4. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  5. Replies: 1
    Last Post: 08-23-2012, 08:32 AM

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