Copy fields from one record into another record in same database

G

GINNY

My user creates a block of records with all fields except
the part number blank. When the parts come in they enter
the remainder of the information. If they have multiple
items that are the same except for the part number and the
serial number, they want to hit a button and have all of
the other information they typed in the first record
copied to the new record. I tried the DLookup function
but i could not get it working. Please help
 
D

david

When I have been copying information from one record to
the next, I have been using the RecordsetClone
functionality.

Dim db as DAO.Database
Dim recClone as Recordset
Dim var as (String/Integer, whatever)

Set db=CurrentDb()
Set recClone = Me.RecordsetClone


recClone.MoveFirst
Do Until recClone.EOF

--- then what you can do is manuever through the
recClone, asking it to check for something---

If recClone!Name = "Smith" Then
(by the way, notice the ! seperator, very important)
var=recClone!FIELD I NEED TO COPY
End If

recClone.MoveNext

Loop

****remember to type in the following code****

recClone.Close

--- finally return to your current record and set the
field you need updated = var ---

Someone else might have a simpler way to accomplish the
same thing, but this type of process has worked for me
several times in the past.

Hope that helps!
 
G

GINNY

Thanks David I will give it a try.
-----Original Message-----
When I have been copying information from one record to
the next, I have been using the RecordsetClone
functionality.

Dim db as DAO.Database
Dim recClone as Recordset
Dim var as (String/Integer, whatever)

Set db=CurrentDb()
Set recClone = Me.RecordsetClone


recClone.MoveFirst
Do Until recClone.EOF

--- then what you can do is manuever through the
recClone, asking it to check for something---

If recClone!Name = "Smith" Then
(by the way, notice the ! seperator, very important)
var=recClone!FIELD I NEED TO COPY
End If

recClone.MoveNext

Loop

****remember to type in the following code****

recClone.Close

--- finally return to your current record and set the
field you need updated = var ---

Someone else might have a simpler way to accomplish the
same thing, but this type of process has worked for me
several times in the past.

Hope that helps!
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top