Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Duplicate data (2003)

    I have created a simple form, which operators enter details that form a sort of log book. Some of the data is repeated all the time, until another operator takes over. For example, there is a field called Furnace No, which the operator has to enter every time he performs an operation, then when another operator starts, he will enter a different number. Because the data is to be entered using a touch screen, I want to cut down on the amount of data having to be entered, therefore avoiding mistakes. Is there a way of duplicating the data in a field, from the previous record, until new data is entered.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Duplicate data (2003)

    I followed the instructions in the article, and it worked, but then I was told that a seperate page is needed for each date, and created another form, inserting the details form as a subform. I'm getting an error now. If I remove the code, and just use the form without duplicating data, it works fine. I've attatched it and would be greatful if you could have a look please.

    Regards,

    Rob

  4. #4
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Duplicate data (2003)

    I did all that, but for some strange reason, when I compact/repaired the database, and converted it to '97, both the module and the text box have gone. I'm going to have to re-do it and repost.

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Duplicate data (2003)

    Here it is. I've not converted it this time. Another thing, after I've run the form and got the error, I can close the database down, but not Access, without using task manager.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Duplicate data (2003)

    There is no code in either form. What do you want people to check for you?

    Ignore this post, you have code in modules.

    You need to follow steps 5 and 6 as follows:
    <pre>5. Open the Customers form in Design view. Change the OnCurrent property of the form
    to read as follows:=AutoFillNewRecord([Forms]![Customers])


    6. Add a text box to the form, and set the following properties: Text Box
    ----------------------------------------------------------
    Name: AutoFillNewRecordFields
    Visible: No
    DefaultValue: CompanyName;ContactName;ContactTitle;Address

    Note</pre>


  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Duplicate data (2003)

    1) The MSKB article assumes the form is a main form. You want to apply it to a subform, hence the function call must be different: set the On Current property of frmDetails to

    =AutoFillNewRecord(Forms!frmLog!tblDetails.Form)

    (tblDetails is the name of the subform as a control on the main form)

    2) The MSKB article mentions that you have to create a text box named AutoFillNewRecordFields listing the fields you want to duplicate. You created such a text box, but named it Text41 or something like that. Rename it to AutoFillNewRecordFields.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •