473,387 Members | 1,295 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Copy at least 1 record or more from one table to another table within the same .mdb

I am currently trying to write an "Inventory Tracking System." I have
a table called "Equipment" that contains information documenting pieces
of equipment ( i.e. Description, Model Number, Serial Number etc. ) and
included in this table are fields with the information of "Who" and
"When" the equipment is loaned out. What I need to do, is to duplicate
the entire record from the "Equipment" table into an "Archive" table
when the equipment is returned back after being "Loaned out" and now
available for redistribution.

Where I'm having trouble is designing code to "Loop" through the
"Equipment" table if a user "Loaned out" Multiple Pieces of Equipment,
similar to a user checking out one or many books from a library.
Can anybody help me with some sample code - ?

Jul 24 '06 #1
2 3291
I think you're going about it wrong.

Why not have a counter that holds the number of pieces of said
equipment available, and when it's returned you add 1 to the counter
and when it's loaned you subtract 1 from the counter? Unless you need
a history of who borrowed something 4 months ago... If that's the
case, track it using a WhoBorrowed table, assign a BorrowID to the
transaction and store it there.

You need to have a better plan or you're going to end up with a
database held together by bandaids. Not everyone can structure a
database properly, you might want to seek advice on how to set it up
first.
kez...@SBCGlobal.net wrote:
I am currently trying to write an "Inventory Tracking System." I have
a table called "Equipment" that contains information documenting pieces
of equipment ( i.e. Description, Model Number, Serial Number etc. ) and
included in this table are fields with the information of "Who" and
"When" the equipment is loaned out. What I need to do, is to duplicate
the entire record from the "Equipment" table into an "Archive" table
when the equipment is returned back after being "Loaned out" and now
available for redistribution.

Where I'm having trouble is designing code to "Loop" through the
"Equipment" table if a user "Loaned out" Multiple Pieces of Equipment,
similar to a user checking out one or many books from a library.
Can anybody help me with some sample code - ?
Jul 24 '06 #2
I built one of these a few million years ago. It's f-u-n fun. you
don't need to move the records at all. You need to put in a ReturnDate
for the loan. The structure is something like this:

Person(PersonID PK, FirstName, LastName...)
Loan(LoanPersonID, LoanItemID, IssueDate, ReturnDate)
Item(ItemID, Description,LossDate)

of course, if you're scheduling, you have to assume most of the
inventory will be returned. I did it by getting a count of matching
items from the items table and subtracting some number. Then if that's
positive, allow the loan/reservation. Albert Kallal has some
interesting notes on this. Check out his website. (check
www.mvps.org/access to find his website...)

There's no need to archive the data, really. You can if you want,
though. You might want to set a flag in the Items table for flagging
lost items.

Jul 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
19
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
7
by: Eric | last post by:
I want to open up 2 record sets. Then, copy everything from one record set to another (excluding a few fields). Is this possible? I need to exclude my primary key, and fields starting with...
0
by: khoegen | last post by:
Folks, I am in the process of designing a database, within which I have created a table called "tblDOCUMENTS". As the title suggests, this is a list of documents (records) of varying types. I...
2
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
7
kcdoell
by: kcdoell | last post by:
Good morning everyone: I created a form and set the default view as a continuous form. Basically the form is displaying records in which the user can add or edit new ones. The record source for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.