Table Design for Assets Inventory with Multiple Asset Type/Asset Attribute Combos

RCopeland

Registered User.
Local time
Today, 10:19
Joined
May 22, 2012
Messages
21
Alright, I need to set up a database for tracking fishing supplies inventory. The problem is that for each type of asset (rods, reels, jigs, hooks, etc.) there are different combinations of attributes that need to be entered.

Eventually I would like to be able to create a form for adding new assets to the database, but am having trouble structuring my tables in a way that allows me to create the form that I want.

The form that I envision would pop-up and give me the option to type the new assets name in a text box, and select the asset type from a combo box. After these are filled out, there will be a "next" button that moves me to a new pop-up form.

This new pop-up form will allow me to enter specific data about the asset I have just entered. The dilemma is that when I select "Rods" for asset type, I should be able to enter specific data that would not apply to a selection for "Reels." I am having a lot of trouble designing my tables to give me this kind of freedom in my forms.
 
Me.SubFormContainer.SourceObject = "sfrm" & Me.AssetTypeID

Can you please explain exactly how this particular part works? The me part seems to be a Macro. Is this right?
 
And just to be totally honest, I am no good with anything code. I am a college student just getting started so please don't get upset with my lack of understanding!
 
So, in my main Assets form, I would add a subform. This subform would then need to have a subform control named subformcontainer? how do I do that?
 
Thank you! Alright, I have successfully done this. Now, when I put the code in my On Current for the main form, I get a runtime error. I am not exactly sure why.

What I have is the main form combo box you named AssetTypeID I have named Catagory. My subforms are named sfrmRods, sfrmReels, etc. When I put the code in my main form, it looks like this:

Private Sub Form_Current()
Me.SubFormContainer.SourceObject = "sfrm" & Me.Catagory
End Sub
 
More specifically, it is a Run-time error '2101': The setting you entered isn't valid for this property.

What am I doing wrong now?
 
Yes, the subforms are all built and named according to "sfrm"+Catagory.

Not sure what you mean by commenting out the code and hard-coding the name of one of the subforms in the sourceobject. Sorry, you probably feel like you're spoon feeding me this stuff.
 
You know what, I am just too uneducated in VBA to do anything without you giving me very explicit step by step directions. I think it would be of benefit to both of us if I just put my project on hold for now, step away from all this frustration, and take the time to learn the basics of VB from the most simple up.

Do you have any advice on where I need to go to begin learning how to write code from the beginning? TIA!
 

Users who are viewing this thread

Back
Top Bottom