Solved Sub form only showing 1 record

Quadcrazi

New member
Local time
Yesterday, 23:47
Joined
Jan 22, 2025
Messages
10
Hello,
For some background, I am working on a database for our family business of buying and selling equipment. I am currently working on the Inventory side of things. Within the 'Edit Item' form there is a button to 'Add Item Expenses'. When you open the 'Add Item Expenses' form, the subform shows the expenses for that specific item via 'ItemID'. The problem is the subform should be showing all the expenses for that item but is only showing 1. I know it's going to be a rather simple fix but I am pretty new at this. Any ideas would be appreciated!
Screenshot 2025-01-22 141313.pngScreenshot 2025-01-22 141616.png
 
What code do you have to open the expense form?
A form can be open in edit mode or add new mode. In the add new mode it goes to a new record and will not show previous records. Also a form has a property called "Data Entry" if that is set then:
 
So what type of form is the target form?
Might be quicker to just upload the dB?
 
Any chance the form in in "Single Form View" not "Continuous Form View"? Check the default view settings of the form.
 
See the attach files button when you reply?
The destination mainform needs it's itemid to be 15 as well?
 
Through the 'ItmID' when the 'Item Expenses' form is opened. Is that what you're asking?

More specifically, form/sub-form links have special fields used to cross-link them. Here is a detailed list of things to consider for sub-forms.


You need to see to the LinkChildField and LinkMasterFields properties to assure that the two parts are properly linked. Seeing only one record at a time when you know you have more than that usually means either a bad linkage or an error in the .RecordSource of the sub-form.
 
Your links are wrong in the subform. They are linked to expID not item id.
Capture.PNG
 
The main form should be bound to Items, and the sub form to item expenses. The main form should not be bound to Item Expeses.. I will fix and send back.
 

Attachments

I couldn't find the link fields until I saw your screenshot and then it clicked! Duh!
I still think you also needed to correct the recordsource of the main form. Technically it would work, but this may have been the cause of your confusion.

This is a really nice and modern looking lay-out. Did you come up with this design all of the icons on your own, or is this based on a template? I am very good at developing access databases, but my designs tend to look like a 1st grader made them.
 
I still think you also needed to correct the recordsource of the main form. Technically it would work, but this may have been the cause of your confusion.

This is a really nice and modern looking lay-out. Did you come up with this design all of the icons on your own, or is this based on a template? I am very good at developing access databases, but my designs tend to look like a 1st grader made them.
Ok I see what you're saying. I will do that. Thank you so much for your help! Clearly I have a lot to learn.

The modern looking lay-out is 100% thanks to Skill Header on YouTube. I followed along and built their "Master Business Accounting Mega Project" for a while before I felt confident enough to start mine from scratch and make it how we need it. It has to be password protected and "idiot proof" so the guys at the shop can't screw it up!
 
You might want to think about audit of the data, or at least look at who created and who changed a record last?

Very good effort though for your perseved level of experience. Well done.
 
You might want to think about audit of the data, or at least look at who created and who changed a record last?

Very good effort though for your perseved level of experience. Well done.
Good idea! I will definitely add that to my To-Do list. I need to finish integrating with my logs table and I could add that information in there as well.
Thank you! It wouldn't possible without people like you with the patience to help the newbies! Thank ya'll again!
 

Users who are viewing this thread

Back
Top Bottom