Results 1 to 13 of 13
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Creating a log, need help auto populating worksheet numbers

    Hey guys,

    Our salespeople get 25 worksheets handed out to them at a time, along with a log. A snip of this log is pictured. Once the salesperson has used all of his/her 25 issued worksheets, he turns in the log with the blank fields all filled in, and gets another batch of tickets. This log is then keyed into a massive excel sheet that is exclusive to each store.

    Currently this log is created in excel, but we want to move it into a centralized access db that contains all info from all stores. The "Sales worksheet #" is the serial number that is pre-printed on the worksheet. The "Simplex #" is the number that will get stamped onto it once that worksheet is used to write up a sale. You will notice that worksheet numbers are always in sequence. The only exception is when a box of the logs runs out, and they open a new box.
    Click image for larger version. 

Name:	checkout.PNG 
Views:	11 
Size:	46.6 KB 
ID:	15274


    Here is what I am trying to create:

    -A master table that will hold every stores checkout log info (created)
    -A form for a clerical to enter the data from a filled out checkout log (easy to create)
    -A form to produce the checkout log that is pictured above (problem child)

    For the last item, I want the form to be quick and simple. Pick a store, then salesperson from a combo box (easy to do). Then pick the work sheet range(s). That is the part that I have no idea how to do. Once the store, salesperson, and range(s) are selected, the form will print. It doesn't have to look identical as the one above, but it needs to have the same general idea.

    Hope I was clear enough on what I am trying to accomplish.

    Also, I need the ability to be able to choose multiple ranges of worksheet numbers, for when a salesperson gets, say, the last 15 tickets from a box of worksheets, and the first 10 from a new box. The box's worksheet ranges are labeled on the outside (annoying, I know), so the last ticket from a box will never be sequential with the first ticket from a new box. Make sense?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Options for creating the printed sheet with pre-filled SalesWorksheetNo:

    1. create records and print report of selected records

    2. some advanced and tricky code to print sequential numbers on report without having to establish records

    Selecting multiple discontinuous ranges for data entry procedure just needs more code.
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Dealing with the multiple discontinuous isn't too big of an issue. I could always just do multiple log sheets for those psuedo-rare situations.

    We will go through roughly 120,000 worksheets a year. We you recommend doing option 1 or 2?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Since you will need the records eventually for the data entry, assuming each record will always have data entered, maybe number 1 - and it might be easier.
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Ok so what is the best way to make a ~500,000 record autonumbered table, starting at 500,000?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Here is one.

    For i = 500000 to 999999
    CurrentDb.Execute "INSERT INTO tablename (WorksheetNum) VALUES(" & i & ")"
    Next
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Thanks June, that worked great!

    Next, I need to push data to that table for when a salesperson checks out worksheets. I have made this form:
    Click image for larger version. 

Name:	form.PNG 
Views:	5 
Size:	3.7 KB 
ID:	15296
    And the master table looks like this:
    Click image for larger version. 

Name:	table.PNG 
Views:	5 
Size:	12.7 KB 
ID:	15297

    So what is the code to append the store, issue date, salesperson (the code next to the name is what will be used) to the records where SerialNumber is between the 2 numbers on the form? I am assuming we are doing a recordset update?

  8. #8
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Actually, you have answered this one for me already

    "If not a bound form, can run an UPDATE SQL (examples for text, date, number fields).

    CurrentDb.Execute "UPDATE tablename SET DO1='" & Me.tbxDO1 & "', DO2=#" & Me.tbxDO2 & "#, DO3=" & Me.tbxDO3 & " WHERE datefield=#" & Me.DelDate & "#""

    Let's see if I can get it to work.

  9. #9
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Code:
     CurrentDb.Execute "UPDATE T_checkout_master set store=" & Me.SelectStore & ", Salesperson='" & Me.EmpCode & "', DateIssued=#" & Me.IssueDate & "# WHERE SerialNumber BETWEEN " & Me.SerialFrom & " AND " & Me.SerialTo & ""
    Works like a charm. How do I put line breaks in there though? I keep getting a "unexpected end of statement" error when I try.

    Code:
     CurrentDb.Execute "UPDATE T_checkout_master set store=" & Me.SelectStore & ", Salesperson='" _    
    & Me.EmpCode & "', DateIssued=#" & Me.IssueDate & "# WHERE SerialNumber BETWEEN " _
    & Me.SerialFrom & " AND " & Me.SerialTo & ""
    That was my attempt.
    Last edited by June7; 02-08-2014 at 12:17 PM.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    I would have thought that should work. However, I always do: & _
    Don't forget space between & and _

    Store and SerialNumber actually a number type?
    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.

  11. #11
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Click image for larger version. 

Name:	error.PNG 
Views:	5 
Size:	15.7 KB 
ID:	15300
    Still doesn't work.

    Yes, both store and SerialNumber are number types.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    If the line starts or ends with literal text, must precede or follow with " mark.

    CurrentDb.Execute "UPDATE T_checkout_master set store=" & Me.SelectStore & ", Salesperson='" & _
    Me.EmpCode & "', DateIssued=#" & Me.IssueDate & "# WHERE SerialNumber BETWEEN " & _
    Me.SerialFrom & " AND " & Me.SerialTo
    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.

  13. #13
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Gotcha. Appreciate the help! Solved!

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

Similar Threads

  1. Auto populating on a Form
    By Canadiangal in forum Forms
    Replies: 1
    Last Post: 03-28-2013, 04:54 PM
  2. Auto Populating a new form
    By mikejames in forum Access
    Replies: 12
    Last Post: 09-25-2011, 11:41 AM
  3. Auto populating fields from MS access
    By fawazeto in forum Forms
    Replies: 0
    Last Post: 04-04-2011, 08:25 PM
  4. new guy with a question on auto populating
    By zdiver07 in forum Forms
    Replies: 2
    Last Post: 05-03-2010, 11:06 PM
  5. Auto populating date.
    By emccalment in forum Access
    Replies: 3
    Last Post: 02-19-2010, 11:00 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