accessnewbness
New member
- Local time
- Today, 15:14
- Joined
- Oct 1, 2009
- Messages
- 3
Hi all. I'm completely self-taught in Access and VBA, and have come across a problem on a database that I'm trying to put together to manage rental equipment for my company.
Simply put, we have different categories that this equipment falls under, with different numbers of physical attributes about the equipment being tracked.
Simplified example:
Pumps, attributes including Voltage, Horsepower, Material
Tanks, attributes including Height, Diameter, Capacity, Material
There are many categories, and some things we want to track up to 10 different attributes. I originally was going to place each individual attribute into its own column in a large table, but it looked like I would end up with something like 50 different columns, and that just didn't make sense.
So, what I decided to do was make an "Attributes" table (tblAttributes) with basically three columns (ID, Category, Attributes), where the user would be able to enter
ID (auto), Category, Attribute
1, Pumps, Horsepower
2, Pumps, Voltage
3, Tanks, Capacity
4, Pumps, Material
5, Tanks, Diameter
Etc.
By doing this, i was able to limit my attributes fields in the rental equipment table (tblRental) to only 11 fields, which is an ok number to work with. For reports and searching, this is fine, I know how to consolidate those fields and present them. That way anything dealing with a particular piece of equipment would only present non-null fields when describing the equipment.
What I want to do is make an Rental Equipment Entry form that is dynamic, so that when the user picks a particular category (let's say pumps) of equipment from a combo box, the form looks at the Attributes table, finds all the attributes for Pumps, counts that there are 3entries, presents controls for Attribute1, Attribute2, Attribute3 and makes the associated labels to guide the user to input the data.
Then, on another category (Tanks), the form finds only 2 attributes, so it creates text boxes associated with Attribute1 and Attribute2, and creates the associated labels for them.
This way, I only have to make one form, and as we add more equipment into this rental pool, I have to enter the equipment's category and the particular attributes I want to track. Right now I have specific forms created for each category all laying overtop of one another, and I'm playing with the .visible property with an If/Then statement to bring the right one up to the foreground.
This is definitely messy, and is a pain in the butt when I want to make a layout change, as I have to change all the different forms.
Please keep in mind i've really simplified the example, and am fine with using easy bits of code and modifying them to my needs.
I don't know if this is really a "form" question, a VBA question, a data structure question, or what, but I'm just freaking stuck because I really don't know what i'm doing.
I appreciate any and all advice and help (in advance), and will be more than willing to learn about things recommended...I just don't even know what I'm looking for here.
Please fire away with any questions, but keep them simple...I'm not the smrtest!
Thanks!
Simply put, we have different categories that this equipment falls under, with different numbers of physical attributes about the equipment being tracked.
Simplified example:
Pumps, attributes including Voltage, Horsepower, Material
Tanks, attributes including Height, Diameter, Capacity, Material
There are many categories, and some things we want to track up to 10 different attributes. I originally was going to place each individual attribute into its own column in a large table, but it looked like I would end up with something like 50 different columns, and that just didn't make sense.
So, what I decided to do was make an "Attributes" table (tblAttributes) with basically three columns (ID, Category, Attributes), where the user would be able to enter
ID (auto), Category, Attribute
1, Pumps, Horsepower
2, Pumps, Voltage
3, Tanks, Capacity
4, Pumps, Material
5, Tanks, Diameter
Etc.
By doing this, i was able to limit my attributes fields in the rental equipment table (tblRental) to only 11 fields, which is an ok number to work with. For reports and searching, this is fine, I know how to consolidate those fields and present them. That way anything dealing with a particular piece of equipment would only present non-null fields when describing the equipment.
What I want to do is make an Rental Equipment Entry form that is dynamic, so that when the user picks a particular category (let's say pumps) of equipment from a combo box, the form looks at the Attributes table, finds all the attributes for Pumps, counts that there are 3entries, presents controls for Attribute1, Attribute2, Attribute3 and makes the associated labels to guide the user to input the data.
Then, on another category (Tanks), the form finds only 2 attributes, so it creates text boxes associated with Attribute1 and Attribute2, and creates the associated labels for them.
This way, I only have to make one form, and as we add more equipment into this rental pool, I have to enter the equipment's category and the particular attributes I want to track. Right now I have specific forms created for each category all laying overtop of one another, and I'm playing with the .visible property with an If/Then statement to bring the right one up to the foreground.
This is definitely messy, and is a pain in the butt when I want to make a layout change, as I have to change all the different forms.
Please keep in mind i've really simplified the example, and am fine with using easy bits of code and modifying them to my needs.
I don't know if this is really a "form" question, a VBA question, a data structure question, or what, but I'm just freaking stuck because I really don't know what i'm doing.
I appreciate any and all advice and help (in advance), and will be more than willing to learn about things recommended...I just don't even know what I'm looking for here.
Please fire away with any questions, but keep them simple...I'm not the smrtest!
Thanks!