Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Record In Subform Cannot Be Saved

Discussion in 'Information Technology' started by ksenya.lim@gmail.com, Jul 28, 2006.

  1. ksenya.lim@gmail.com

    ksenya.lim@gmail.com
    Expand Collapse
    Guest

    Hey,

    I created a form with a subform in it (form and subform have
    one-to-many relationship, primary key is a number). When I tested the
    subform I realized that it is impossible to save any records in it. In
    the data tag in Properties it is set to allow edits, deletions, data
    entry, etc. What can be the solution to this problem?

    Thank you all in advance!
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Some things to consider:

    1. Is the subform based on a query? If so, can you save new records in the
    query?

    2. Open the main form in design view.
    Right-click the edge of the subform control, and choose Properties.
    What is in the LinkMasterFields/LinkChildFields properties?
    Is this correct?

    3. Are there fields in the subform's table that are required, but they are
    not shown on the subform?

    4. How is AllowEdits set in the *main* form? If it is No, the subform on the
    main form won't allow edits either.

    5. Are you able to edit the controls, but unable to save? Or are you unable
    to edit anything?

    6. How are the Locked and Enabled properties of the controls set?

    7. What error message do you get when you try to save?

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    <ksenya.lim@gmail.com> wrote in message
    news:1153208636.206197.173360@h48g2000cwc.googlegroups.com...
    > Hey,
    >
    > I created a form with a subform in it (form and subform have
    > one-to-many relationship, primary key is a number). When I tested the
    > subform I realized that it is impossible to save any records in it. In
    > the data tag in Properties it is set to allow edits, deletions, data
    > entry, etc. What can be the solution to this problem?
    >
    > Thank you all in advance!
    >
     
  4. ksenya.lim@gmail.com

    ksenya.lim@gmail.com
    Expand Collapse
    Guest

    My form is based on a table. I could add and save records in the main
    form but not in the subform. Anyway, I solved my problem changing the
    primary key from Number to Auto Number without knowing why it didn't
    work with Number.
     
  5. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    AutoNumber assigns a value automatically.

    Were you actually entering a number for the primary key field when it was
    not an Autonumber? The record cannot be saved without a value for the
    primary key, and the number would have to be unique.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    <ksenya.lim@gmail.com> wrote in message
    news:1153222560.230266.214850@m73g2000cwd.googlegroups.com...
    > My form is based on a table. I could add and save records in the main
    > form but not in the subform. Anyway, I solved my problem changing the
    > primary key from Number to Auto Number without knowing why it didn't
    > work with Number.
     
  6. ksenya.lim@gmail.com

    ksenya.lim@gmail.com
    Expand Collapse
    Guest

    I was entering a number for the primary key when entering data and it
    worked just fine but when I wanted to add records to the subform it
    wasn't possible.
    After changinf the primary key to Auto Number I encountered the same
    problem again and wierdly i solved it changed Properties - Data Tag -
    Data Entry from Yes to No. That is the first time I'm creating a
    database in Access and unfortunately for me, don't understand what I am
    doing.
    Thanks for your help. I've got a few handy tips from your web site.

    Allen Browne wrote:
    > AutoNumber assigns a value automatically.
    >
    > Were you actually entering a number for the primary key field when it was
    > not an Autonumber? The record cannot be saved without a value for the
    > primary key, and the number would have to be unique.
    >
    > --
    > Allen Browne - Microsoft MVP. Perth, Western Australia.
    > Tips for Access users - http://allenbrowne.com/tips.html
    > Reply to group, rather than allenbrowne at mvps dot org.
    >
    > <ksenya.lim@gmail.com> wrote in message
    > news:1153222560.230266.214850@m73g2000cwd.googlegroups.com...
    > > My form is based on a table. I could add and save records in the main
    > > form but not in the subform. Anyway, I solved my problem changing the
    > > primary key from Number to Auto Number without knowing why it didn't
    > > work with Number.
     

Share This Page