How to create new record with an old record (1 Viewer)

bacardi451

Registered User.
Local time
Today, 21:10
Joined
Mar 20, 2002
Messages
33
Hi,
I have a record that has contact name, update combobox, date, and 2 number fields. What i am trying to achive is when I go to update a record instead of changing all the information I would like to select the record and create a new record with all the information except the date and update filed.

Example: 1st record looks something like this

contact name: Alvarez
update: New
date: 08/02/02
visit number: 1425
total alloted time: 1HR

The way i am trying to make this work i would like to view this record and then have a command button that generates a new record with the above information with the exception of update and date

Example
contact name: Alvarez
Update:
date
visit number:1425
total alloted time : 1HR

is there any way to do this.
I am new at this
Thank you
Al
 

Fornatian

Dim Person
Local time
Today, 21:10
Joined
Sep 1, 2000
Messages
1,396
Do a search on this forum for default values, the easiest way to achieve what you need is to dynamically set the default value of the fields in question then goto a new record where the default values will show.

Please come back if still stuck as I am now off to work so can't offer more explicit advice.
 

ghudson

Registered User.
Local time
Today, 16:10
Joined
Jun 8, 2002
Messages
6,194
The wizard in Access 97 has a Duplicate record function but I prefer the control my method below offers because I do not always want all fields duplicated. Follow my example to do what you want.

Dim sFirstName As String
Dim sLastName As String
Dim sMailingLocation As String
Dim sPhoneNumber As String

sFirstName = FirstName 'FirstName is the name of the table field
sLastName = LastName
sMailingLocation = MailingLocation
sPhoneNumber = PhoneNumber

DoCmd.GoToRecord , , acNewRec

FirstName = sFirstName
LastName = sLastName
MailingLocation = sMailingLocation
PhoneNumber = sPhoneNumber

sFirstName = ""
sLastName = ""
sMailingLocation = ""
sPhoneNumber = ""

HTH
 

Users who are viewing this thread

Top Bottom