Append query using RunSQL

L

Leif

I'm trying to add a record to a table currently being
displayed in my form. Even though the form is set as a
dynaset, I'm not seeing the added record until I exit the
form and reenter. I've tried adding a requery statement
to my form current event, to force the form to show the
newly added record. That works, but it takes about 20
seconds with a lot of blinking of the form in the
meantime. My database is on my local machine, so the
delay is not due to a network or number of users.

I could try setting up a recordset clone using DAO, and
append a new record. I'm not sure if that will work
better or not. Anyone have an idea why I'm having this
problem?

Thanks.
 
T

tina

i don't know that i'd do a form-level requery on the OnCurrent event, seems
like you'd get caught in an endless loop, though you did say your code
actually completes after 20 seconds or so.
how are you calling the code that appends the new record? from a data
entry-generated event? or from a command button click event? have you tried
putting the form-level requery at the end of the same code that appends the
record?

hth
 
L

Leif

-----Original Message-----
i don't know that i'd do a form-level requery on the OnCurrent event, seems
like you'd get caught in an endless loop, though you did say your code
actually completes after 20 seconds or so.
how are you calling the code that appends the new record? from a data
entry-generated event? or from a command button click event? have you tried
putting the form-level requery at the end of the same code that appends the
record?

My code is in a Before update event of a combo control.
If I place my requery in that even I get a Run time error
2115: "The macro or function set to the BeforeUpdate or
ValidateRule property for this field is preventing
Microsoft Access from saving the data in the field."

Leif
 
T

tina

you're appending a record to the form's underlying table - in a control's
BeforeUpdate event? maybe you better give some detail on what your process
is, and what's you're trying to accomplish.
 
G

Guest

I solved my problem by moving the requery to the after
update event of the combo control. Thanks.
 
Top