How to replace field data in table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all....

I need to take a field 'vehiclelocation' from a form and when the user
clicks on save, insert the field into the table 'tblVehicles', specifically
the field 'CurrentLocation'.

On the form, I need to be able to enter the vehicle location at the time of
data entry so I can view the history of the vehicles location, but I want to
be able to view the last entry for the specific vehicle from the table
'tblDispositions'

Should I be using RecordsetClone and FLast? or is there an easier way?

I do not want to write another record, just replace whatever is already
there.


Cheers
 
Paul

I'm not quite clear on what you are trying to accomplish. You mention a
"history of the vehicles location", but say you want to "just replace
whatever is already there". These seems contradictory.

You say you want to insert a field into a table -- does this mean add a new
field, or add the value to an existing field?

Is your field on the form bound to the field in the table?
 
Hi Jeff...

I have a table that lists the vehicles, and in it is a field
'CurrentDisposition'.

I have another table that keeps a record of all dispositions for all
vehicles.

What happens is I fill in a form linked to 'tblDispositions' and I want to
take the field 'Disposition' and replace the 'CurrentDisposition' in the
'tblVehicles'. That way when listing the vehicles, it will always show the
last disposition entered.

Cheers
 
Paul

If you have a form bound to tblDispositions, that sounds like a way to keep
track of the history, not the vehicle.

If you have a form bound to tblVehicles, you could have a control on that
form bound to your CurrentDisposition field in the table. And you could add
a procedure to the form's AfterUpdate event that would:
a. check to see if the disposition changed (i.e., value <> OldValue), and
b. write a "history" record consisting of vehicleID and Disposition and
date/time to the tblDispo

Or have I completely misunderstood your situation?
 
Back
Top