create new entry using data already entered

R

Ruth

Hi there

I have a form that opens up in edit mode from a botton in another form.
Using:

DoCmd.OpenForm "FormName", , , , acFormEdit


I have created a list box so a previous entry can be pulled up. I want a
new entry to be created with the data from the old entry rather than saving
any changes in the old entry. The field that would differentiate the new
from the old is the date and time of entry. I have an automatically
generated primary key in the database, I don' t know if it is a factor or not.

How do I do this?
 
K

Ken Snell \(MVP\)

By "old entry", do you mean the item selected in the record entered just
prior to the new record on which you're currently entering data -- while the
form has remained open? Or do you mean the item last selected, based on
date/time value for that item, when the data were edited, even if during a
prior session with the form?

Show us examples of your data, too, so that we can see what you mean by
"date and time of entry", etc.
 
R

Ruth

I mean the item last selected, based on the trip number and the date/time
value for that item. A trip may last several days and we get reports on the
trip at least once a day.

Part of the data looks like:

Vessel Trip No Report Date Location Next Port ETA for
next Port
boat 1 3 12-26-07 12:50 BRE SSM
12-28-07 01:00
boat 2 11 12-26-07 06:00 CLE FAO
12-26-07 13:30
boat 3 3 12-26-07 07:30 DUL PCO
12-31-07 23:00
boat 1 3 12-27-07 11:00 WIN SSM
12-28-07 04:30

--
Thank-you!
Ruth


Ken Snell (MVP) said:
By "old entry", do you mean the item selected in the record entered just
prior to the new record on which you're currently entering data -- while the
form has remained open? Or do you mean the item last selected, based on
date/time value for that item, when the data were edited, even if during a
prior session with the form?

Show us examples of your data, too, so that we can see what you mean by
"date and time of entry", etc.
 
K

Ken Snell \(MVP\)

I apologize for my late reply; I have been out of town longer than I'd
planned on a work project.

Do I understand correctly that you want the user to make a selection from
the listbox, and then the form shows the data for that selection? And you
want that form to start with a new record that is based on the last entry
for that selection?

If this is correct, I also assume that the data that should be filled in for
the new record are Vessel, Trip No, and Location (using the value from the
Next Port field of the previous entry)?

Do you also use the listbox's value as a parameter in the form's
RecordSource query so that the form will show just the records pertaining to
that selection? And that you use the AfterUpdate event of the listbox to
requery the form's RecordSource?

Let me know if I'm understanding your setup correctly.
--

Ken Snell
<MS ACCESS MVP>



Ruth said:
I mean the item last selected, based on the trip number and the date/time
value for that item. A trip may last several days and we get reports on
the
trip at least once a day.

Part of the data looks like:

Vessel Trip No Report Date Location Next Port ETA
for
next Port
boat 1 3 12-26-07 12:50 BRE SSM
12-28-07 01:00
boat 2 11 12-26-07 06:00 CLE FAO
12-26-07 13:30
boat 3 3 12-26-07 07:30 DUL PCO
12-31-07 23:00
boat 1 3 12-27-07 11:00 WIN SSM
12-28-07 04:30
 

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