How do I issue items from a multi-level inventory? (1 Viewer)

L

ltl

Guest
**Overall Problem**

I'm trying to create an inventory database that you can check items out to the people associated with the database but I can't figure out how to create the form to do this. Any help would be greatly appreciated.

**Background information**

First, here are the associated data structures:

>Tables<
People: LastName, FirstName, PersonID
Items: ItemID, Description
Inventory: ItemID, Size, NumInStock, InventoryID
Issued: PersonID, InventoryID, DateIssued, DateReturned

Each ItemID is unique to a particular category of item, however, it can have more than one size in the Inventory form. More than one item from inventory can be issued to the same person in the Issued form.

>Queries<
Inventory: Description, Size, InStock, ItemID, InventoryID
Issued: LastName, FirstName, Description, Size, DateIssued, DateReturned, InventoryID, PersonID

At the moment I have a form that allows you to select a person from a drop-down list and it will then show you the items from inventory (in a datasheet subform) that the person has been issued.

Currently that form looks like:
Code:
-------------------------------------------------------
   Select Person {Combo Box}

   LastName       FirstName
   {Text Box}     {Text Box}

   <Datasheet Subform>
   Issued Items:
   Description    Size        DateIssued   DateReturned
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   ...
-------------------------------------------------------

This is great to display what a person has been issued, but what I would really like is the ability to issue additional items to a person from this form. Currently if I try to create a new row in the datasheet, I get either the error that "Field cannot be updated" or "Cannot add record(s); join key of table 'Issued' not in recordset" depending if I try to add a new row by writing in Description or Size vs. DateIssued or DateReturned.

**Desired solution**

What I want is the ability to issue a new inventory item by first selecting the Item Description from a drop-down combo box, and then select from the allowable sized for that Item from a Size drop-down combo box. This should correspondingly update the Issued form with a PersonID and Inventory ID. It should also subtract one from Inventory.NumInStock for that item (and perhaps return an error if the num in stock is 0?). How do I go about doing this?

I would like the form to look either like:
Code:
-------------------------------------------------------
   Select Person {Combo Box}

   LastName       FirstName
   {Text Box}     {Text Box}

   <Datasheet Subform>
   Currently Issued Items:
   Description    Size        DateIssued   DateReturned
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   ...

   <Datasheet Subform>
   Issue New Items:
   Description    Size        DateIssued
   {Combo Box}    {Combo Box} {Text Box (default date of today)}
   {Combo Box}    {Combo Box} {Text Box (default date of today)}
   ...
   [Issue These Items]{Button}
-------------------------------------------------------
and when you click issue these items it moves the items from the lower half of the window into the upper half because they've been issued. Alternatively, instead of having the ability to issue multiple items at once, it could just issue one at a time such as:
Code:
-------------------------------------------------------
   Select Person {Combo Box}

   LastName       FirstName
   {Text Box}     {Text Box}

   <Datasheet Subform>
   Currently Issued Items:
   Description    Size        DateIssued   DateReturned
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   {Text Box}     {Text Box}  {Text Box}   {Text Box}
   ...

   Issue New Item:
   Description    Size        DateIssued
   {Combo Box}    {Combo Box} {Text Box (default date of today)}
   [Issue This Item]{Button}
-------------------------------------------------------

**How do I do this???**

Regardless, somehow I need to get the Item.ItemID from selecting the description, and using that ItemID present the appropriate sizes, then using those sizes, get the appropriate Inventory.InventoryID, and once you click the button, it gets the Person.PersonID to update the Issued form with the right values. All this is well over my head since I've never used Access before! Any help?

Thanks a million!
LtL

PS. In addition to subtracting one from the inventory count when adding records, I would also like to add one to the inventory count when DateReturned is set. I don't know how to do this either, but adding the record is a higher-priority.
 

dan-cat

Registered User.
Local time
Today, 01:46
Joined
Jun 2, 2002
Messages
3,433
You have quite alot of work to do here ltl :(

Am I right in thinking that even though each item has a unique Id - the quantity of that item can be more than one? I'm presuming this because you have a number in stock field.

If so perhaps you should add a field within your items table storing the basic quantity of the item. Also if an item comes in different sizes - why not attribute each sized item with its own unique item id?

Once an item is booked out then you can adjust the basic quantity of the item accordingly.

Alot to do here - can you perhaps post a sample?

Dan
 
L

ltl

Guest
I am apparently unable to attach the database to this post as the server claims it is too big, even after I have deleted most of the entries in it. You can find it here:
http://s95367829.onlinehome.us/urgh.zip

The items table basically denotes the main categories, of which there are approximately 30. Each of these categories has subcategories, with the total number of subcategories over all records totalling around 800. Without a two-tier selection method, it would take a long time to scroll through 800 entries looking for the one you want.

In the sample you can download I've removed most of the entries so you can view it easier, but the real thing is rather large. Specifically see the Issued form for what I'm wanting to get working.

I hope this helps to understand my problem better!
Thanks again!
 

dan-cat

Registered User.
Local time
Today, 01:46
Joined
Jun 2, 2002
Messages
3,433
I got a little bored today so I had a nibble at your db.

If anyone has any kindly criticism please shout. :)
 

Attachments

  • urgh.zip
    76.7 KB · Views: 916
L

ltl

Guest
That's really cool. I'm going to have to see if I can dissect the form to figure out how you get everything to work.

It's not exactly what I had envisioned, but is very very close. Most pressing is the selection of the item to check out. The list in the slimmed-down database only has about 15 inventory items in it, but the large list has about 800. Since I'm not going to be the one using the database, I would really like to present the description (instead of the itemID) to the user, which modifies a second drop-down to select the size so that they don't have to scroll through a list of 800 items.

The only other bit would be how to set the dates issued and returned. Since some people already have items checked out, I want to be able to specify a date that the items were checked out when adding them to each individuals' issued list. Also, people can have more than one of the same item checked out, whereas you have somehow been able to restrict them to only check out one of an item. (How did you do this, btw?) Finally, the return date should also be able to be specified for the reason that the database isn't always going to be updated in sync with the actual checkouts and returns.

I looked through the macro you made but I don't understand how it updates anything at all... Am I missing somewhere else to look for code?

But in any case, this is really awesome!!!! :D How do you learn how to do all this stuff?
 

dan-cat

Registered User.
Local time
Today, 01:46
Joined
Jun 2, 2002
Messages
3,433
PM your email address and I will give you a talk through.

The answer to your 'How do you learn how to do all this stuff?' question is simple.

I search through the vast archive in this forum to get my answers.
There are alot of bright people around here giving free guidance and info. Most answers can be found with the search facility but you will almost always get a friendly answer if you post a question.

Best forum I've ever come across ;)
 

Users who are viewing this thread

Top Bottom