Results 1 to 8 of 8
  1. #1
    SSgtBarry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Yuma, AZ
    Posts
    17

    Generate Blank Records

    I need to be able to generate blank records for a report and / or form.



    Example... I work with hundreds of trucks. My co-worker (we'll call him Bob) has a number of customers. When a customer calls, who needs trucks, Bob will create an order. Bob will scratch a number of lines on a piece of paper. If the customer needs 7 trucks, Bob will scratch 7 lines on the paper. Bob will then call Trucking Companies to fill the customers order. If a Trucking company can only fill 2 trucks, the first 2 lines will have info about THAT particular Trucking Company. Bob will then go to the next Trucking Company and fill each line on the paper with info, until the 7 lines are full.

    I need to create a query (or code) that will automatically generate empty records, based on a number (example 7). From those empty records a report with 7 lines (records) will print, so that Bob can jot info for later data entry.

    How can I generate report lines, based on a "given number"?

    Thanks in advance!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    I once experimented using code to do this and found the results unsatisfactory but might just have been something funky about my report.

    Review http://www.vb123.com.au/200310_dl_pad.htm

    An alternative is to build a 'blank' report that is simply filled with UNBOUND textboxes or line controls. You will likely have more 'rows' than needed but will make your life much less stressful.

    So why does Bob need a printed blank document? Why is he not just entering data directly into a form on computer?
    Last edited by June7; 10-21-2017 at 07:48 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.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Care to post your dB?

    We do something similar - we open a form and it appends 1 - 3000 blank records (1 - 3000 people). 1 field has the emp id and another has the number 1111 entered.
    the data is filled in - maybe not for everyone. When the form closes, any record with an entry in the field that has 1111 is deleted.

    Don't know what your table structures are, so can't give/suggest a good solution....

  4. #4
    Join Date
    Apr 2017
    Posts
    1,776
    1. You create a saved query for order based on your database;
    2. You change the created query to UNION query, appending n empty rows for every order (only field filled will be PK for order, and maybe some another fields used in report header only), where n is the number of trucks needed, and set ORDER BY in a way, that empty rows are displayed as last;
    3. You base your report on this saved query, like "SELECT TOP n FORM YourSavedQuery WHERE OrdeID = x", and edit the report's querystring in VBA before calling the report to adjust n and x. For your example, in the printed report will be 2 rows with info, and 5 empty rows in report's body.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    7 was an example, another order might require only 4 and another 10, etc.

    It's my impression the only data is the order info, there are no trucks selected, when this document is printed. The purpose being a convenience to hand note info taken during phone call.
    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.

  6. #6
    Join Date
    Apr 2017
    Posts
    1,776
    Quote Originally Posted by June7 View Post
    7 was an example, another order might require only 4 and another 10, etc.

    Did see this after finished editing my post.

  7. #7
    SSgtBarry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Yuma, AZ
    Posts
    17
    Thank you for your response! I will give that a try!

  8. #8
    SSgtBarry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Yuma, AZ
    Posts
    17
    Thanx for the info

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

Similar Threads

  1. Generate more identical records like first one
    By vazdajic in forum Programming
    Replies: 13
    Last Post: 09-21-2017, 02:23 PM
  2. Generate report with blank linked table fields
    By e-support in forum Reports
    Replies: 14
    Last Post: 01-06-2017, 04:11 PM
  3. Need to generate one blank row, new to Access
    By AccessOneRow in forum SQL Server
    Replies: 10
    Last Post: 03-14-2016, 05:48 AM
  4. Generate Multiple Records at Once
    By macollins in forum Programming
    Replies: 3
    Last Post: 12-13-2013, 12:55 PM
  5. Auto generate records
    By RokitRod in forum Database Design
    Replies: 1
    Last Post: 10-02-2012, 10:45 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