I have three subforms inserted on my main form. The first subform (Vehicles) links to the second subform (Estimate). Now, I need to link the second subform to the third subform (Billing).
Out of frustration, I have put PK (Primary Key) and FK (Foreign Key) in all the tables and subforms. How do I link the three forms?
Adam Schwanz 13 months ago
Not sure by your wording, but if all 3 link to the main form, you should have a PK on the main form and each subform should have a FK that matches, just link with that. If you mean your subforms sort of cascade off each other, then main form PK needs to go to FK in subform1, PK in subform1 goes to FK in subform2, etc... You may need to requery to cascade.
Sami Shamma 13 months ago
Also check that "Link Master Fields" and the "Link Child Fields" are correctly set for each of the subfprms.
You may need to create a separate textbox on the main form just to grab the link field from the second subform. See picture below. All the link fields need to be available on the main form. Since the 2nd subform's link field is inside the 2nd subform, it has to be brought to the main form in the manner shown in the picture.
Kevin Yip 13 months ago
Michael JonesOP 12 months ago
Thank you all or your suggestions. I have followed them and been able to get sub form 1 Cust Vehicles and 2 Service History working but not 3 Service Materials. I have tried different ways but can't get it to work,
I need to get Service Materials to show the material used for each vehicle in Service History. I think the answer is with the suggestion from Kevin Yip but I have no idea how to do this, very frustrated.
Is it possible to get someone who would be interested in looking at my DB and fixing the problem.
Kevin Yip 12 months ago
Hi Michael, create a textbox on the main form with the following properties:
Name: AnyName
Control source: =[2nd subform name].[Form]![2nd subform link field name]
Visible: No
Then go to the 3rd subform control's property sheet and put in the link field names:
Link master fields: [main form link field], [AnyName]
Link child fields: [3rd subform link field 1], [3rd subform link field 2]
I use placeholder names above ("AnyName," "2nd subform name," etc.), so use your own names for your forms.
Michael JonesOP 12 months ago
Hi Kevin. Again thank you for your help. Sorry I think I am going brain dead, tried to follow your instructions but failed to get it to work.
Is there anyway I can send you my DB so you can show me what I did wrong. Its only a small DB with just sample data.
Sorry if I am being cheeky in asking.
Kevin Yip 12 months ago
Hi Michael, you may post screenshots and/or further descriptions of your database, but I cannot accept and physically touch your database, because once I do that, it will be considered consulting work, which will be a whole other matter.
You may ask for consulting help at the "Access Developer Network" forum section on this site. Here is the post you made there: https://599cd.com/blog/display-comment.asp?CommentID=79167 . You need to make another post emphasizing the need for someone else to physically inspect and modify your database.
I'm retired, so unfortunately I can't accept any such work.
Many posters on this site run businesses with Access, so I take these requests seriously. I would need to know everything about your business before I could touch any of your stuff. Likewise, you wouldn't want anyone touching your stuff unless he knows about your business. The only way to have such trust is via a consultant-client relationship.
My previous post has fairly basic info. If you find that too difficult, then you need to continue your study, such as with the courses here. As I said, you can continue to ask for help here with screenshots and what not. But nothing can substitute for going through a proper curriculum.
Michael JonesOP 12 months ago
Thanks Kevin I understand what you are saying. I am also retired but was just doing this as a favor to friend and have not worked on DB for a ew years and only did it as a sort of hobby.
I created this same DB for this friend many yrs ago, with some the help. The part I needed help with was done by this other person so I don't know how he did it.
Anyway, the DB worked fine for them, then last week he asked me if I could make a few changes to the DB. No problem, however after I made the changes they would not save !!!! I tried every thing I new to fix the problem but failed. The DB is still working fine but the only suggestion I had was that I re-create the DB, hence the problem.
I have all of the tutorials up to expert 20 but didn't purchase any others as I stopped working on any DB.
Once again a big thanks to everyone for their help.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access TechHelp.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.