Copy Data from Previous Record

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I have a form that is on the new record. I want to have a command button
that will copy all the data from the last record. I know there's a duplicate
record option, but i just want to make it easier for the users.
 
Ben

If you are basically duplicating the information from a previous record,
your table structure may need a bit more work.

If you were using a spreadsheet, that's pretty much how you'd create a new
record (duplicate an old one, change a few fields).

But Access is a relational database ... you won't get very easy or good use
of Access' relationally-oriented features and functions if you feed it
'sheet data.

If you'll describe a bit more about your subject area, and how your table is
now design, folks here may be able to offer alternate approaches that can
better utilize Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I have a main table called SNS and a subform called SNSAIs

FieldNames for SNS

SNSID - Autonumber (PK)
ProjectName - Text (SNS Default Name)
Leads - Text
PlanningDate - Date/Time
DeployDate - Date/Time
ImplementationDate - Date/Time
TrainingDate - Date/Time
PlanningStatus - Text
DeployStatus - Text
ImplementationStatus - Text
TrainingStatus - Text
Other - Memo
WARFK - FK to main table called WAR.

SNSAIs are a multiple rows of AIs that have a 1-Many relation to SNS table.

SNSAIID - Autonumber (PK)
ActionItem - Text (255 chr)
Owner - Text
SNSFK - FK to SNS

That's all it is. I want to have a button that copies, for example, all of
the data in record 2 to record 3..that includes the data in the SNS AI table.

Thanks

Ben
 
Ben

A couple observations...

Your SNS table has multiple fields named [xxxxxDate], so I'm guessing you
are tracking when (i.e., the date) things happen in relation to (?) a
project. Again, as I mentioned in my earlier email, using multiple columns
to track multiple (types of) dates is how you'd do it with a spreadsheet.
To get more use from Access, consider creating another "many" table that
holds four fields (at a minimum):

trelProjectEvents
ProjectEventID (PK)
ProjectID (FK - ?SNSID)
DateType (FK - create a lookkup table with the types of events you
track - e.g., planning, deployment, ....)
ProjectEventDate

This way, you only have as many rows as you have dates for, and you can add
new events to track by just adding them to the lookup table.

Take a look at your multiple [xxxxxStatus] fields ... the same holds as for
the [xxxxxDate] fields.

I don't understand why/how your "project" table is related to your WAR
table.

I don't understand what is being stored in your [Leads] field ... from the
name of it, it sounds like it could have "many" things in it.

So, you're saying you want to have multiple rows in your SNSAI table that
duplicate each other ("copy ..."). Why? If you are using a standard main
form/subform construction, the subform (SNSAI) data will automatically be
given the correct parent ID. And I'm guessing you aren't actually giving
the same [Owner] the same [ActionItem], so how does copying help? You've
described "how" ... now, "why", as in "how does having the copy help
you/your users?"

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top