Link to home
Start Free TrialLog in
Avatar of hrufescens
hrufescens

asked on

Access 2000 subform displays data, but will not allow data input- unusual data tables

I have two tables.  'tabDoc' is a list of documents.  'tabLinkParents' has three fields:  a key field, and two fields that lookup the foreign key for documents in 'tabDoc'.  The purpose is to keep track of parent-child relationships between the documents.

I have a form based on tabDoc with a subform based on tabLinkParents.  The subform is for inputting or displaying the parent documents.  'Link Child Field' is set to the key for the child document (a coincedence!) in tabLinkParents, and 'Link Master Field' is set to the document key in tabDoc.  That way, for each document in the database, the subform displays the parent documents.  

The subform displays data correctly when I add data to the tables directly, but when I try to add data using the subform, I get the following error message:  

The LinkMaster fields property setting has produced this error: 'the object doesn't contain the Automation object 'tabDoc.''

BTW, I can sucessfully add records to tabLinkParents using the query for the subform, so I know its not a problem with a non-updateable record source

Is there a  problem having simultaneous relations between two of the fields in tabLinkParents and the (single) primary key of tabDoc?

Suggestions for fixing the subform?

Thanks,
Brandon
Avatar of jadedata
jadedata
Flag of United States of America image

Hey hrufescens!

  The relationship of the Form/Subform is reverse of the relationship of the actual data

  Parent       Child
  Form         Subform
  ChildDoc     ParentDoc

  This configuration is bound to be giving you difficultly if you are using the Master/Child links to control the view.

  Whats the chance of reversing the document displays so that the Parent doc is always the one on the main form?
regards
Jack
Avatar of hrufescens
hrufescens

ASKER

Jack,

Sorry, wouldn't make sense to reverse the displays.

Yes, the configuration gives me difficulty!  I think its set up right, though.  The form is for a given document.  The subform shows its parent documents.  In terms of Access, the parent is the form, and the child is the subform.  I'm with you.

My table 'tabLinkParents' has fields ID_LinkParents (an autonumber key field), ID_Parent, and ID_Child.  These latter two have relations with the same key field in tabDocs.  So my form is linked to the key field for tabDoc, and my subform is linked to ID_Child in tabLinkParents.  That way, for a given document (ID_Child), the subform will show all parents (ID_Parent).

I've done lots of other subforms in this db successfully. This one gives me the heartburn, though- is it because  the two fields in tabLinkParents are linked to the same key field in tabDoc?

Thanks,
Brandon
ASKER CERTIFIED SOLUTION
Avatar of jadedata
jadedata
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks jadedata,

Your comment didn't solve the problem, but that's not your fault.  You did force me to go back and look at what I was taking for granted.  Everything looked right in the Access user interface, but something was screwed behind the forms.  I just started the forms from scratch ("exactly" as before!) and they work.

Having two fields reated to the same field in a second table was not the problem. Gremlins were, I guess...

You get the points- thanks again for responding

Brandon
excellent work sir.  I own a copy of the gremblins shirt too!
thanx for the question!