Results 1 to 2 of 2
2001-09-06, 01:50 #1clf111Guest
Learning How to Pass values (Office 2K)
I am working on an inventory db for a class I am taking on databases-we haven't done Access at all, so its hard to get help there. I believe I need to use some code, and I know what I want to do is doable, I'm just not comfortable with it. Macros I got, I just to have the the experience with vba.
I'm having 2 flavors of the same problem.
1. When you hit a button to add an item to inventory, you get a form to add basic info, like the inventory tag, where the inventory is located, etc. Then, the next task is to add the details of that type of inventory. I've got forms and tables for the different types of inventory: pcs, printers, etc. What I want to do is to save the main inventory record, then insert a new record into the printer form (for example), set the value of the inventory tag in that record to equal the inventory tag from the main form, and open that record in the form, ready for editing.
2. To upgrade equipment, I have a parm query where you input the inventory tag of the piece you want to record activity on. I've got the main inventory form with a subform showing activity (on sept 5 it was deployed, on Oct 10 it was upgraded, etc.) just fine. I've got a tabbed with a page for each type of inventory, with the subform for each on its respective tab, but I need to be able to click on the tab to get focus, and open the subform of the right record (again, inventory tag is the key.)
I know this instructor won't be grading on Access..he can't he hasn't taught it, but I need to get over this hump to represent database principles.
Thanks in advance to anyone who can help.
2001-09-06, 04:09 #2
- Join Date
- Dec 2000
- Sacramento, California, USA
- Thanked 1 Time in 1 Post
Re: Learning How to Pass values (Office 2K)
Sorry, but it isn't clear what your table structure looks like. If you have separate tables for different types of equipment, then you've already gone astray. You would normally (and I use the term advisedly) have a table for equipment, with fields in that table to indicate the type of equipment rather than separate tables for each type of thing.
The equipment table would contain all the fields that apply to equipment in general, like type, brand, model, color, serial number (assuming you are accounting for individual pieces rather than groups), etc, as well as the inventory ID from the inventory table. If you are recording individual pieces of equipment and need to gather specialized details on a particular type, you could use a one-to-one table to hold that specialized information--things like number of trays for a printer or whether it was a color printer or did duplexing. Those tables would have the same primary keys as the linked record in the equipment table but you would only have a record in the second tables for items of that particular kind in the equipment table. Your activity would be captured in a separate table that included the inventoryID and the type of activity.
Your subforms need to be linked to the parent form through the master and child links using the inventory key (tag or whatever). That way, whichever record is current on the parent form will automatically limit the contents of the subforms.Charlotte