The newly created record is now shown in the form

Discussion in 'Microsoft Access Forms' started by Mehrdad, Jun 25, 2010.

  1. Mehrdad

    Mehrdad Guest

    Hi there,

    I have created a table in Access which includes several fields and
    also have created a form for entering data to this table. Many records
    that I have to enter data have many common attributes and I don't want
    to type all these attribute for each new record. Instead, I need to
    copy the content of one record and paste this content to create the
    new record.

    To achieve this, I added a button to the form and added DoCms.RunSQL
    to create a new record based on the existing record in the form. When
    I hit the button a new record created in the table, but in the form
    there is no indication that a new record has been created (total
    number of records shown on the form remains unchanged). Even if I move
    to the first and last record, I cant see the newly create record. Only
    if I close the form and I reopen it, I can see that the new record is
    shown in the form.

    Does anyone know why the newly created record is not accessible
    instantly in the form?

    Many thanks
     
    Mehrdad, Jun 25, 2010
    #1
    1. Advertisements

  2. Try doing a Requery.

    --
    Doug Steele, Microsoft Access MVP
    http://www.AccessMVP.com/DJSteele
    Co-author: Access 2010 Solutions, published by Wiley
    (no e-mails, please!)

    "Mehrdad" <> wrote in message
    news:...
    > Hi there,
    >
    > I have created a table in Access which includes several fields and
    > also have created a form for entering data to this table. Many records
    > that I have to enter data have many common attributes and I don't want
    > to type all these attribute for each new record. Instead, I need to
    > copy the content of one record and paste this content to create the
    > new record.
    >
    > To achieve this, I added a button to the form and added DoCms.RunSQL
    > to create a new record based on the existing record in the form. When
    > I hit the button a new record created in the table, but in the form
    > there is no indication that a new record has been created (total
    > number of records shown on the form remains unchanged). Even if I move
    > to the first and last record, I cant see the newly create record. Only
    > if I close the form and I reopen it, I can see that the new record is
    > shown in the form.
    >
    > Does anyone know why the newly created record is not accessible
    > instantly in the form?
    >
    > Many thanks
     
    Douglas J. Steele, Jun 25, 2010
    #2
    1. Advertisements

  3. Mehrdad

    Jeff Boyce Guest

    If you are trying to "copy the content of one record and paste this content
    to create the new record", your data may be organized more like a
    spreadsheet than a relational database.

    So what, you ask? So, MS Access is optimized for well-normalized data.
    Both you and Access will struggle to overcome 'sheet data.

    Before you go any further, consider revisiting your data structure, with
    normalization in mind.

    If "relational" and "normalization" are unfamiliar terms, plan on learning
    more about them before expecting Access to work easily/well for you.

    (and by the way, is there a reason you don't just use a spreadsheet instead?
    What is it that you expect Access to do that you couldn't do with, say,
    Excel?)

    Regards

    Jeff Boyce
    Microsoft Access MVP

    --
    Disclaimer: This author may have received products and services mentioned
    in this post. Mention and/or description of a product or service herein
    does not constitute endorsement thereof.

    Any code or pseudocode included in this post is offered "as is", with no
    guarantee as to suitability.

    You can thank the FTC of the USA for making this disclaimer
    possible/necessary.

    "Mehrdad" <> wrote in message
    news:...
    > Hi there,
    >
    > I have created a table in Access which includes several fields and
    > also have created a form for entering data to this table. Many records
    > that I have to enter data have many common attributes and I don't want
    > to type all these attribute for each new record. Instead, I need to
    > copy the content of one record and paste this content to create the
    > new record.
    >
    > To achieve this, I added a button to the form and added DoCms.RunSQL
    > to create a new record based on the existing record in the form. When
    > I hit the button a new record created in the table, but in the form
    > there is no indication that a new record has been created (total
    > number of records shown on the form remains unchanged). Even if I move
    > to the first and last record, I cant see the newly create record. Only
    > if I close the form and I reopen it, I can see that the new record is
    > shown in the form.
    >
    > Does anyone know why the newly created record is not accessible
    > instantly in the form?
    >
    > Many thanks
     
    Jeff Boyce, Jun 25, 2010
    #3
  4. Mehrdad

    Mehrdad Guest

    On Jun 25, 4:23 pm, "Jeff Boyce" <> wrote:
    > If you are trying to "copy the content of one record and paste this content
    > to create the new record", your data may be organized more like a
    > spreadsheet than a relational database.
    >
    > So what, you ask?  So, MS Access is optimized for well-normalized data.
    > Both you and Access will struggle to overcome 'sheet data.
    >
    > Before you go any further, consider revisiting your data structure, with
    > normalization in mind.
    >
    > If "relational" and "normalization" are unfamiliar terms, plan on learning
    > more about them before expecting Access to work easily/well for you.
    >
    > (and by the way, is there a reason you don't just use a spreadsheet instead?
    > What is it that you expect Access to do that you couldn't do with, say,
    > Excel?)
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Access MVP


    Hi Jeff,

    I am familiar with the "normalization" in the database design, but for
    this small project this is not an issue. The only thing is that there
    are a couple of records that are somehow similar. So I want to enter
    data for these similar record once, and then modify only those
    attributes that are different.

    By the way I could manage this by Duplicate Record functionality in
    Button Control Wizard.
     
    Mehrdad, Jun 25, 2010
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    Created form Not shown in Form View - Problem ?

    Guest, Jul 28, 2006, in forum: Microsoft Access Forms
    Replies:
    1
    Views:
    111
    Guest
    Jul 28, 2006
  2. Guest

    Where did my newly created form go ?

    Guest, Jul 29, 2006, in forum: Microsoft Access Forms
    Replies:
    0
    Views:
    128
    Guest
    Jul 29, 2006
  3. 12.nv.us
    Replies:
    4
    Views:
    278
    12.nv.us
    Feb 20, 2009
  4. Frank Situmorang

    The found record still now shown up

    Frank Situmorang, May 15, 2009, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    122
    Frank Situmorang
    May 18, 2009
  5. KarlHardeman

    Populating fields in a newly created form in Access 2007

    KarlHardeman, Jul 30, 2009, in forum: Microsoft Access Forms
    Replies:
    3
    Views:
    150
    Keith Wilby
    Jul 30, 2009
Loading...

Share This Page