updating subform datasheeet cols auto

  • Thread starter Thread starter p
  • Start date Start date
P

p

I have a subform datasheet with many rows.. When a user enters a new row,
column one of six, I need to query another database to automatically
populate the remaining subform datasheet columns. I have the select from
the other database working but am looking for best method/location to update
the other columns in datasheet?

I tried adding code to the subform textbox "After Update" to update table.
Found this event only is triggered for first row AND found the data has not
been written to database yet, so the SQL update fails since there is no data
yet.

I think I want to hook the subform datasheet "After Insert" and update the
database with new data after data has been commited. BUT, HOW DO I know
which row is being inserted?

Is there a way to reference other subform datasheet controls, so I can
populate them, before record is commited? How do I determine what is being
inserted?

Thanks in advance.
P
 
I am not exactly sure this will help but here is a theory.

Make a Temporary table and use it to append the records
you need .... after you append the records delete them
from the old table.... then On Form Close event append
them back to old table and delete them from the Temporary
Table.
 
Don,

I ended up using the datasheet "after Insert" method since changes are not
actually in db until then. I queried the table for the last row inserted
and sorted on an identify column in desc order. Then took the (last inserted
field) to query the other database, took these results and updated the local
access table. two selects and one update and a refresh. Ugly but it works..

P
 
Back
Top