Using Access 2010. Fairly new to automation and macros.
I have two tables (tblProductReceived
and tblBins
) and a form (frmProductReceived
).
A field in tblBins
corresponds to a location the bin is at (named BinLocationID
) and the tblProductReceived
table tracks product that a specific bin has received.
What I need is for the tblProductReceived
field PRLocationID
([tblProductReceived].[PRLocationID]
) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]
) when selecting a specific bin in the form (frmProductReceived
).
Is there an easy way I can do this? I'm really new at macros/vba and I would extremely be grateful for some tips/suggestions!
Also, there is no object in the form for the PRLocationID
field. I want it to be updated behind the scenes based on the bin number field the user selects ([tbl.Bins].[BinID]
)
Here are images of tblBins, tblProductReceived, and frmProductReceived: http://imgur.com/a/0IUHm/ (can't post images quite yet without reputation)
See this is the structure i have:
tblProductReceived is a table that records items that were deposited into bins.
tblBins is a listing of physical drop locations (bins) that contain a field BinLocationID
BinLocationID actually corresponds to another table (tblLocations) that has all the locations.
But I can't simply link the field from tblBins to tblProductReceived's because sooner or later bins can move from location to location (whatever the reason is is unimportant). This is the reason why I need a copy of [tblBins].[BinLocationID] to be copied over to [tblProductReceived].[PRLocationID] because should a bin move, it would mess any analysis (as we want to keep track of where the product was dropped off at, not only the location of the bin).
Also, the form I set up does have the drop down to the various bins ([PRBinID] in [tblProductReceived] — (i use a lookup query on tblBins) but keep in mind there is no txtBox for the PRLocationID in the field as it's superfluous. The bins are at location already, all i need is for it to be copied over to the appropriate table.
Am i overlooking anything?