Solved

Access 2013 Data Macros

Posted on 2014-09-24
8
418 Views
Last Modified: 2014-10-02
I'm working on a warehouse database project.  I'm attaching a sample database with 2 tables.  The locations table has all the warehouse locations listed.   A01, A02, B1, Etc.

I have a lookup function on the Table1 that gets the locations from the locations table. It is setup for multiple values.  I need this because some products will have to be stored in multiple locations.  That part was easy.
What I would like to do now and I think the data macros would be the best option is that when a location is selected in table 1 it sets the occupied field in the locations table to true or it hides the location so it can't be selected again.
Database-12.accdb
0
Comment
Question by:Mwvarner
  • 4
  • 2
  • 2
8 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 40343495
As far as I understand: A product can have multiple locations. A location can only have one product?

I would model this explicitly using a bridge table. Cause this allows to declare this kind of relationship, instead of using code to maintain it.

Relationship diagram
with

Bridge table data
0
 

Author Comment

by:Mwvarner
ID: 40344757
That will work but one of the things I'm trying to work out is how to visually represent the locations and indicate which locations are available and which ones are vacant.  Otherwise how can someone who is receiving the pallets know where to tell someone to put them?
0
 
LVL 33

Expert Comment

by:ste5an
ID: 40345596
Use a concatenation function like Allen Browne's.

And use a dialog for assigning the locations.
ConcatRelated.vbs
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40345991
<<What I would like to do now and I think the data macros would be the best option is that when a location is selected in table 1 it sets the occupied field in the locations table to true or it hides the location so it can't be selected again. >>

  Just as a general comment, I don't think you really want that.   The concept of not storing a product in a given location more than once is not a good one.  Most inventory systems have two levels:

1. Location
2. Lots

Even for the first, you need to be able to handle multiple entries as more often than not, you've got some accounting tied in.   Your accounting may be done on FIFO, LIFO, etc.   In order to account for that, you need to be able to receive  to a location multiple times.

So normally, you'll have tables that look like this:

tblLocations - One Record per location
LocationID - AN - PK
LocationCode - Text - CK1 - "AA01", "AA02", "AA03"
LocationType - Long - Floor, Rack, Bin etc

tblItems - One record per item
ItemID - AN - PK
Descritption

tblLocationQtys -
LocationQtyID - AN - PK
LocationID - Long
ItemID - Long
QtyReceived
ReceivedOn
Cost

 This allows you to have:

1. Different items in the same location.
2. The same item in the same location several times (so you can keep track of multiple receiving or costs)

 It also let's you handle cases where you might now have a rack, which can only hold a single pallet, but then you change to a floor setup, which might hold a dozen pallets.

 So you really do want to allow for multiple records of an item to exist in the same location.

Jim.
0
 

Author Comment

by:Mwvarner
ID: 40346193
I still don't see how I will be able to visually represent the locations and show which locations are available and which ones are filled.   Do you know of any warehouse data base examples that do this?
0
 

Author Closing Comment

by:Mwvarner
ID: 40357859
This solves the table structure I think but it still doesn't answer my question on how to visually represent the storage areas and which locations are occupied and which are not.
0
 
LVL 57
ID: 40357881
<<I still don't see how I will be able to visually represent the locations and show which locations are available and which ones are filled.   Do you know of any warehouse data base examples that do this? >>

  You would do that on the tblLocations record; a simple Y/N of "IsLocationFilled".

  Then it's simply a WHERE (criteria) check on the flag:

 SELECT * FROM tblLocations WHERE IsLocationFilled = False

  just as you might be putting a pallet away and want only locations that will hold pallets.

Jim.
0
 

Author Comment

by:Mwvarner
ID: 40358431
That should work.

Thanks Jim
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now