Status check for update query

mderby

Registered User.
Local time
Today, 22:03
Joined
Apr 14, 2003
Messages
41
Hi guys out there,

I have a form Work with a subform Detail on it. User will entering the data on Detail and click a button called SAVE on the bottom
of Work form. The SAVE button will called an update query UP to insert new records from Detail form to a table Work Order.

This is working perfectly but I need a way to check the status of the update query whether the records is successfully added or is there any error. Will anyone know which system variable should use to get this value. I need this status to deny user from saving the records more than one time.

Thanks.
 
Why are you using an unbound form? If you bind the form to the table, or a query based on the table, you won't need an explicit save.

Or have I misunderstood?
 
Neil, I think the user is pulling records from one table and appending them to another - i.e., not using the form/subform for data entry.

If this is the case, you can use the RecordsAffected DAO property to return the number of records affected by the most recently invoked Execute method.

If you're using ADO, use the RecordsAffected parameter of the Execute method to get the number of records affected.

Look up both of these in the Access online help.
 
RecordsAffected

cx was correct on the data entry. I need to append the data to another table as well as the form's bound table.

But CX, I am using an Update Query to append the data not through DAO or ADO will I still get to used the RecordsAffected
property ? Perhaps there is other parameter I can use to check
the status of the update query ....

TX.

:)
 
Got it !

Finally I found a solution to it.

I just use the ERR.Number as the status check. If there is no error
with the APPEND Query which mean ERR.Number=0.

This solve the problem.

:D
 

Users who are viewing this thread

Back
Top Bottom