One query--three subforms

sjl

Registered User.
Local time
Today, 02:35
Joined
Aug 8, 2007
Messages
221
Good morning,

I have one query (based on primary key from my main table, plus another table). I need to make three subforms (on one tab/page) based on this one query.

I have had several problems as I have tried to get this to work (e.g., not being able to key data into the subforms (they seem to be locked), blank lines showing up in subforms 2 and 3).

Currently, I am getting this message:

"The changes you requested to the table were not successful b/c they would create duplicate values in the index, primary key, or relationship). Change the data in the field(s) that contain duplicate data, remove the index or redefine the index to permit duplicate entried and try again"

I have checked my table properties for all the fields and only the primary keys (studyID on Main table and autonum on MTA table) do not allow dups. Would this be creating the problem?

I have checked the Child-Master links for each subform, they are linked on correctly.

Any other ideas?


This is the general setup...all on one tab:

Subform1 MTA#...........Name1..........Date1,.......... etc1, etc


Subform2 MTA#...........Name2..........Date2,.......... etc2, etc
Subform3 MTA#...........Name3..........Date3,.......... etc3, etc


(all 3 subforms are based on same query)


Thanks in advance,
Sjl
 
I THINK I figured out the problem (fingers crossed):

after checking that I didn't have indexes denoted incorrectly (i.e. dups not okay where they should be),

1. I found that in View|Indexes...there were 2 relic fields in there which were formerly associated with my new MTA table, so deleted them.

2. deleted some old relationships in the Relationship tree

3. removed all relationships to my MTA table in order to do #4...

4. deleted my auto num field in my MTA table, in order to "reseed" it, and added back an autonum field

5. amended query which was based on above MTA table; restoring relationships as well

I've tested it 4 or 5 times now and have not gotten the error message (nor am I locked out). Sloppy development (didn't clean up fields/relationships) on my part.

sjl
 
Re: One query--three subforms--ANOTHER PROBLEM

Now back to the problem I had before the indexing problem (mentioned previously)

How can I relate the three subforms to each other?

I've attached a print screen of my current problem:

When a record is keyed in (I want one record to straddle the three subforms), instead of all of record #1 appearing on lines #1 of the three forms, the data appears on line 1 in subform1, on line 2 in subform2, and on line 3 in subform3.

Any ideas?

thanks
sjl:(
 

Attachments

First I think you only need one subform to do what you are asking. The reason you get the errormsgs is because you are trying to open 3 subforms based on the same query.

make your main form have the primary key on it and the subform have the rest of the data you require and make the form a datasheet or a tab form and that will fix your errors.
 

Users who are viewing this thread

Back
Top Bottom