Requery creating multiple records on back end

G

gcasper

I have an app done in front end/back end style, with the database on the
backend and the user app on the front end. Users enter new records on the
front end app. I have a seperate app running on the backend allowing that
user to print forms for the new records entered by the front end users.
Problem is... To be sure the new records are available on the backend app, I
use a me.requery command to get the latest added records into the recordset.
This appears to cause SOME of the records in the process of being entered on
the front end to write their current info to the current record and then
create a NEW record to which the remainder of the data entry gets posted!
It's MADDENING!!! What's going on here? It doesn't happen EVERY time, but it
does happen SOME times. What would case a requery on the backend to cause the
records being created by the frontend users to split like that?

TIA for your help!
 
J

John W. Vinson

I have an app done in front end/back end style, with the database on the
backend and the user app on the front end. Users enter new records on the
front end app. I have a seperate app running on the backend allowing that
user to print forms for the new records entered by the front end users.
Problem is... To be sure the new records are available on the backend app, I
use a me.requery command to get the latest added records into the recordset.
This appears to cause SOME of the records in the process of being entered on
the front end to write their current info to the current record and then
create a NEW record to which the remainder of the data entry gets posted!
It's MADDENING!!! What's going on here? It doesn't happen EVERY time, but it
does happen SOME times. What would case a requery on the backend to cause the
records being created by the frontend users to split like that?

In general, it shouldn't.

A Requery is the wrong hammer to drive this nail, though; if you want to force
a record on a form to be saved to the table, you can use either

DoCmd.RunCommand acForm, Me.Name, acSaveRecord

or

If Me.Dirty = True Then Me.Dirty = False


John W. Vinson [MVP]
 
G

gcasper

Thanks John, but I'm not having trouble saving the record. As users complete
the entry of their info on the front end, they go to the guy running the
backend program, which is already up and running... And he prints their
forms. In order for him to see their data, I have to requery the database to
pick up the records they added from the frontend. And it's some of THOSE
records that, for whatever reason, wrote multiple records due to the requery
taking place on the backend. Does that make sense?
 

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