Record In Subform Cannot Be Saved

K

ksenya.lim

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!
 
A

Allen Browne

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?
 
K

ksenya.lim

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.
 
A

Allen Browne

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.
 
K

ksenya.lim

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top