After Update, After Insert

C

cefrancke

I'm trying to update some combo boxes and subform data (including their

combo boxes too.) after inserting a record into a different subform.

I insert a record into subformA (tableA is underlying).
The After Update(AU) event fires, the AU code inserts a record into
tableB, then it requerys all related combo boxes, subformB (tableB is
underlying) and subformB combo boxes.


This works for one record, however all requeries fail (that is, they
have no effect).
AND....the amount of records in tableB is one short of what it should
be.


Any ideas?


TIA
 
L

Larry Daugherty

It sounds like you haven't actually saved the record in subform B.
Make sure you do that and then add a line

me.refresh

in both forms either when all done adding records or when each record
is added.

HTH
 
J

John Vinson

I'm trying to update some combo boxes and subform data (including their

combo boxes too.) after inserting a record into a different subform.

I insert a record into subformA (tableA is underlying).
The After Update(AU) event fires, the AU code inserts a record into
tableB, then it requerys all related combo boxes, subformB (tableB is
underlying) and subformB combo boxes.


This works for one record, however all requeries fail (that is, they
have no effect).
AND....the amount of records in tableB is one short of what it should
be.

Please post your code.

John W. Vinson[MVP]
 
C

cefrancke

My apologies,
I meant to say that upon MULTIPLE record inserts, that is,
pasting more than on record at a time,
the requeries fail, etc as before.

So, for one record the requeries apparently work for combos,
subforms and subform combos.

On pasting multiple records, it doesn't work.

TIA
 
J

John Vinson

My apologies,
I meant to say that upon MULTIPLE record inserts, that is,
pasting more than on record at a time,
the requeries fail, etc as before.

So, for one record the requeries apparently work for combos,
subforms and subform combos.

On pasting multiple records, it doesn't work.

TIA

How are you "pasting" (and for that matter, why are you pasting rather
than running an Append query, which is much more efficient)?

Again... please post your code. You may be doing nothing wrong
(perhaps the insertion operation hasn't completed??) but since we
don't know what you're doing, there's no way to tell.

John W. Vinson[MVP]
 

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