Results 1 to 6 of 6
  1. #1
    Ivanuke is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    2

    Copy last record textboxes except one.

    Hello. I have a form I created to inputting driver load tickets for my employees. Everyday I input 20 or so tickets per driver into the database with the only info being different is serial number per ticket. With the form I have I fill in the necessary information and then click copy last record. This saves the current record and creates another record and tries to save that as well (Which I do not want) and then I have to change the serial number of the ticket of the copied record. How can I create this copy of last record and have it delete the serial number text box field leaving it blank to input a new serial number while keeping all other information, and not saving the copied record until I select save? In the macro for the Copy New button I set a Set property command with "value" and i left the value field blank, when I clicked the button an error message popped up that I need a value for this textbox. Im assuming Access is trying to save the record when I select copy. In reality I would just like to auto populate the information from the last record minus the serial number.

    Thank you.

  2. #2
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    Why not create a table to hold tickets then another for Driver Tickets so instead of copying all the fields all you need to is select the drive/Serial Number

    tblDrivers
    tblDriverTickets
    tblTicketInfo

    just of the top of my head.

    hope it helps mick

  3. #3
    Ivanuke is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    2
    Thanks for the reply.

    The driver tickets I don't know what number they will be. I own a dump truck service and whatever load ticket we receive I will input them in. I have a table called DriverTickets, Employees,Customer,Vehicles. Everyday I input the driver, vehicle, customer info, work date, and each ticket is serialized with a certain dollar amount. I have to input these into the database so I know how much to pay our employees at the end of the week. I then take a report of these tickets to each customer and invoice them for the dollar amount of the tickets. The customer has a carbon copy of these tickets so they know they are legitimate. They check our report with theirs and they pay.

    Im using Access 2016. I forgot to mention that.

    Thanks

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,740
    You might consider an unbound form. But I don't think a macro could do the transfer of form data to the table. You would need VBA to do that behind the save button.
    You wouldn't need to copy the data, as an unbound form would not blank out after saving. The save button code could blank out the ticket textbox after saving the record.
    This might also be more complicated if your current form updates more than one table.
    Also, the unbound form would not let you view or scroll thru existing records, so it would be a single purpose data entry form.

  5. #5
    Mickjav is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Location
    Margate, Kent
    Posts
    123
    If your having to copy that many record or even one record then theres something not right with the design.

    but to do it use the unbound form davegri Suggested then create a button with a loop for x times

    For x=1 to N
    You could run an append query but would be better to use a recordset
    Next x

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe this tip will help you: Assign default values from the last record

    I would have tested it, but you have not posted a copy of your dB with a few examples.

    Good luck with your project......

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

Similar Threads

  1. Replies: 14
    Last Post: 11-20-2013, 11:27 PM
  2. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  3. Replies: 1
    Last Post: 11-28-2012, 04:14 PM
  4. Replies: 1
    Last Post: 07-25-2011, 09:41 AM
  5. Hide textboxes only on new record.
    By SRSA in forum Programming
    Replies: 2
    Last Post: 02-28-2011, 04:31 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