Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

trouble with max date query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JCM - 14 Aug 2006 20:47 GMT
I have what seems a very simple issue but has been a major problem for
me to resolve...

I have 2 tables; 1 (widgets) describes my items in detail and includes
a unique primary identifier for each type of widget (not an
autonumber).  The second (location) describes where the widgets are
stored.  The 2 tables are linked by the primary identifier.  The
locations table includes the storage room, row, shelf and box.  My
database is set up so that new widgets are entered via a form (and
subform for location) and if they are moved from one location to
another, a new row is made with the new location in the location table.
Since this row has the date, a totals query with max date and the
primary ID joined to a current location query will tell me the current
location.

This part has been easy.  The hard part comes when I move a box of
widgets.  Each box contains many different widgets, though with some
similar aspect, and has a unique id.  I have set up my new location
form so that I can enter the primary ID, the Box ID or both.  The
trouble is that if I move an entire box, the primary ID field for the
new location is empty, and, as a result, when the query is run I don't
get what I want.  The responses I get are myriad and depend on the
joins but so far none have been quite right.

Any suggestions would be greatly appreciated.  I'm a advanced
beginner/intermediate with access.
Jeff Boyce - 14 Aug 2006 23:00 GMT
I can't quite tell if you are storing the WidgetID or the BoxID in the
Location table.  Are either/both going into the same field in tblLocation?

Where's your table that shows which Widgets are in which Box?

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I have what seems a very simple issue but has been a major problem for
> me to resolve...
[quoted text clipped - 22 lines]
> Any suggestions would be greatly appreciated.  I'm a advanced
> beginner/intermediate with access.
JCM - 15 Aug 2006 13:54 GMT
Jeff, tblLocation has fields for both widgetID and BoxID.  WidgetID is
the primary key in tblWidget.  A particular WidgetID and BoxID can
occur many times in tblLocation.  TblLocation shows which widgets are
in which box, as box is the primary location for the widgets.

Thanks, JM

> I can't quite tell if you are storing the WidgetID or the BoxID in the
> Location table.  Are either/both going into the same field in tblLocation?
[quoted text clipped - 32 lines]
> > Any suggestions would be greatly appreciated.  I'm a advanced
> > beginner/intermediate with access.
Jeff Boyce - 15 Aug 2006 17:40 GMT
If I understand your description of your "domain",

   one Widget (i.e., WidgetID) can be zero-to-one Box (BoxID)
   one Box can be in only one Location (LocationID)
   one Box can hold one-to-many Widgets
   one Widget can be in only one Location
   one Location can hold zero-to-many Widgets (if in a Box)
   one Location can hold zero-to-one Box

From your description, if you have more than one Widget in a Box, you have
to enter multiple records in the Location table.  This seems
counter-intuitive.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Jeff, tblLocation has fields for both widgetID and BoxID.  WidgetID is
> the primary key in tblWidget.  A particular WidgetID and BoxID can
[quoted text clipped - 40 lines]
>> > Any suggestions would be greatly appreciated.  I'm a advanced
>> > beginner/intermediate with access.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.