Problems with subform data entry

reglarh

Registered User.
Local time
Today, 08:54
Joined
Feb 10, 2014
Messages
118
I have already posted this problem without getting any resolution. I have had posted a working solution but unfortunately the reasons why the suggestions were made are beyond my understanding. Any help preserving my sanity would be appreciated!

I have three tables consisting of:

1. A member table

System assigned primary key
Member Number, indexed, no duplicates
Member Name

2. Groups table

System assigned key
Group Code, indexed, no duplicates
Group Name

3. Group members

System assigned primary key
Group System Assigned Key
Members System Assigned Key

NB composite index defined on last two fields, no duplicates allowed

Forms

1. Members, allows input of member number and member name
2. Groups, allows input of group code and name

Database relationships

Members linked to Group members, one to many, enforce referential integrity
Groups linked to Group members, one to many, enforce referential integrity

Using wizards, I created a Groups form with a GroupMembers subform.

All very simple, as simple as one could ever get in a database design.

However, I cannot ever get the subform to accept new entries, i.e. to add a member to a group. I get a message saying that the record cannot be entered since duplicate record, index or similar will occur. When I open the GroupMembers table in datasheet mode and add records, (having listed out the System Assigned keys and manually input them) I can use the Groups/GroupMembers subform to list all the members I have input via the datasheet mechanism.

I next tried removing the Autonumbered link fields on the GroupMembers table and replacing then with the actual group code and members number. Once again I could create entries via a datasheet bout this time the subform would not allow any data entry.

:banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:

Who can talk me through how to achieve my goals?

My final object is now to have a main/subform to allow entry of members into groups via a tabular subform. I would like to input a member number and for the system to reflect back to me the name to confirm correctness.

It's not much!
 
PS

I do not want to get involved in Visual Basic (at least at this stage!). I Have used some macros in earlier parts of my application to do simple things like menu selection, closing forms etc, but I am absolutely convinced that my basis needs here could be satisfied by the use of simple forms design and wizards.:)
 
Can you post a copy of your db in A2003 mdb format.
 
Ok, take a look at the attached db which I think now does what you wanted. However, I'm not sure that you are designing your db in the "Normal" way. Can you tell us a little more about its' purpose.
EDIT
Forgot to attach db. Should be there now.
 

Attachments

It's a membership system of an organisation that comprises many subgroups. I developed the front end data input (other than assigning members to groups) and back end reports and queries. I came unstuck filling in the middle, so what I posted was just a simple demo of the issue I came up against. The key points are:

600 members
80 groups
groups consist of 8-30 members.
 
Bob - yes exactly!

What did you do to make it work?
 
But this was created automatically by Access!
 
Bob

I note your comment about the design of the simplified application I originally included only the system generated IDs from Groups and Members tables since the codification and number system of members and groups will need rationalising soon. I removed them to see if it made any difference. What frustrates me is not understanding why, having defined the relationships between the tables and using wizards for the form design, the system generated an inappropriate SQL statement. Do you have an answer for that?
 
What concerned about your db specifically was that you have fields defined in your tables as PK's which are AutoNumbers, These usually make excellent candidates as Pk's but you appear to be actually using and defining in the relationship window other fields (possibly more natural) to be used as the Primary and Foreign Keys.
 
Yes, I took some time to decide for the reasons mentioned.

But why did Access not produce the correct SQL?

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom