Access error

puniverse

Registered User.
Local time
Today, 14:24
Joined
Apr 18, 2013
Messages
24
can Someone please help. I keep getting an error on the project list main form that I have spent countless hours trying to figure out. I am having problems with the project parts subform. If you click on project list then click new and in the form there is a parts subform and the error I get is "database cannot find the table projects with key matching fields project". please help.
 

Attachments

Try to switch the Form.DefaultView property to Single form instead of Datasheet (parts subform), then you'll see you have to choose a projekt from the combo-box (Project), (this is where your problem lies).
 
JHB thanks for your help and changing it to single form worked but I still do not see my problem. Yes I can add the parts with single form but I am trying to see all the parts I have added for that Project. I also do not want to have to pick the project since choosing the wrong project can be caused by human error. Expenses works fine and it is identical. I have also checked my relationships and it should be working. Can I please get more assistance.
 
How can I get the main form to automatically be inputed into the parts subform so that I do not have to automatically do it? I currently get the cannot find record error while in datasheet view and when I use singform I have to manually input the project. Can someone please help.
 
.... but I still do not see my problem ...
The problem is that you have to manually choose the project, it has to be filled in automatic. You do not have the right Master Fields link and the Child Fields link between the main and the sub forms.
You've Master Fields link = "ID" and Child Fields link = "ID", the correct is Master Fields link = "ID" and Child Fields link = "Project".
 
Last edited:
JHB I cannot believe how I missed something so simple and the sad part is I checked it twice. It now works thank you.
 
@puniverse - just a word of warning: if you have vba code which renews the sourceobject for the subform control it will automatically reset the link child and master fields to 'ID' (not quite sure of the full rules but something along the lines of Access finds this field name in both parent and subform recordsource and they are defined in Options/Object Designers/autoindex and/or they are indexed in the table), so you also need to include VBA to set these to the right value.

Hope that makes sense:D
 
JHB I cannot believe how I missed something so simple and the sad part is I checked it twice. It now works thank you.
You're welcome, did you read my signature? :)
 

Users who are viewing this thread

Back
Top Bottom