Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Users adding records 1

Status
Not open for further replies.

dbero

Technical User
Mar 31, 2005
109
US
I am intending to have a backend database updated with new records by individual databases for each user. I am using the abbreviated code below to add a new record.

Is there a more efficient way to add records and prevent two users from being on the same record than using the select * statement? I know I could use a where statement, but thought there may be an even better way to prevent any chance of error.

Addtransaction.Open "Select * from TaskTable", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Addtransaction.AddNew
Addtransaction!User_ID = SystemID
etc.
etc.

Thank you
 
Don't know how. I've used an append query from a query, but never from a form. Could you explain?

 
I think you are going to have to describe again what you are trying to do.

The way I read your Q i thought you were entering data to a local table and then wanted to to transfer that data to a different database.
 
No, I'm not transfering data between tables.
In this case, a user has a form open. They click a cmd button which gathers values from fields on the form. After the values are gathered, I am opening a linked recordset and adding a new record with the values. Thus creating a new record with the gathered values.
Thanks!

 
So if users are entering data into an unbound form, your code is fine. Can two users be entering the same new record? If so, you need to add error handling to detect a duplicate record when you rs.update.
 

I cant remember how off the top of my head, but opening the table for additions only will speed entry....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top