Base - create a subform that depends on a previous choice

I am new to databases in general so please forgive my general ignorance.

I am trying to create a database to store an inventory of different items, electronic components to be exact. I have made 3 tables to start, a main table that has an ID, Type, Qty fields.
i want to have a subform for each different type, so far, Resistors and Transistors.
I have created two tables, one for each with appropriate fields to identify each.
Im stuck on trying to have the correct sub-form be chosen, when the type is selected.

I have watched many videos, and read many tutorials and am either missing the point or not sure what it is exactly that i’m looking for.
A nudge in the right direction would be awesome.
Thanks

Hello @travism Could you explain your need for three tables? It seems this could all be contained in a single table including the quantities.

resistors have different properties than transistors, resistors have mainly a resistance value, and a power value. Transistors have more, they have a Vbe, Vce, and say Imax, there are many more but just for example purposes. So when i enter an item, and it is a transistor, it has totally different properties and therefore a different table to fill out in the subform.

Hi Travism, can you please advise where there are video tutorials to watch on Base, or did you just search youtude?

@MaaX there are some good videos on this site - click here. Also the Base documentation has many walk through examples and sample DB’s you can download - click here.

@MaaX I have been following along with “the frugal computer guys” videos. I much prefer written guides, but the videos seem more prevalent.

Hello,

This can change based upon your needs (comment) but the sample attached uses one table for all of the inventory. There are three tables involved. The ‘Inventory’ table, ‘Components’ table and a ‘Filter’ table.

The ‘Components’ table just contains all the categories and is used for the list box. The ‘Filter’ table is used for the selection criteria to display the ‘Inventory’ table results. Although all categories are in the same table, only the selected item from the list box will be displayed. This helps in entry and searching.

Sample: ElectronicInventory.odb

Edit:

For an idea of how this would work using macros here is another sample. It has three tables. Capacitors, Resistors, Transistors. There is one form. Upon selection in the list box, the proper table grid control will display.

Sample 2: ElectronicInventory2.odb

This is close. I would prefer to have an actual table field for tolerance, power, etc… rather than sharing a field with other items.

I understand your need for different tables. Selecting a different table based upon a list box selection would require a macro designed specifically for your needs. The probable way to do this would be to Hide/reveal controls as appropriate.

It may be better just to have separate forms for each table to be maintained.

is there an easy way to open another form after entering the generic data, but also force the user to enter at least some data on the next form, specifically a couple required fields? this would achieve exactly what i’m looking for. I’m ok with using macro’s as well, i have more than a little experience using them in microsoft excel. I also dont know how to make this happen either.
The hide/reveal sounds like an ideal solution as well, but if i read you correctly, more complex and difficult?

Your question (another form) is more difficult than the second sample posted. Before going any further, look at the latest sample posted. It uses the hide/reveal technique. BTW LO is quite different when it comes to macros.

I did review your sample, and thank you, I will learn more than a couple things from it.
I have some work to do before I know if this will do exactly what I want. I’m still tripping over basic database things, I have no other database experience so this is all new. I think you have answered my question as well as it can be.

If this answers your question please click on the :heavy_check_mark: (upper left area of answer)