B
Brian Goldhammer via AccessMonster.com
I have the following function set so when a user opens a form to input new
data, a field I have called "DatabaseRecord" is automatically set off of
total records in the table +1. The problem I have is that when two users try
to input data at the same time, the same record number is being pulled for
both entries. Is there a way to set that once a record is open (or being
used), that the function can go to the next available record #?
Thanks,
Brian
------------------------------------------------------------------------------
----------------------------------------------------------------
Function MyCountRecords() As Long
'Establish all of the necessary items to use
Dim dbs As Database
Dim rstOrders As Recordset
Dim lngTotal As Long
Dim Total As Long
Set dbs = CurrentDb
Set rstOrders = dbs.OpenRecordset("Tbl_Orders")
rstOrders.MoveLast
Total = rstOrders.RecordCount
Total = Total + 1
MyCountRecords = Total
End Function
data, a field I have called "DatabaseRecord" is automatically set off of
total records in the table +1. The problem I have is that when two users try
to input data at the same time, the same record number is being pulled for
both entries. Is there a way to set that once a record is open (or being
used), that the function can go to the next available record #?
Thanks,
Brian
------------------------------------------------------------------------------
----------------------------------------------------------------
Function MyCountRecords() As Long
'Establish all of the necessary items to use
Dim dbs As Database
Dim rstOrders As Recordset
Dim lngTotal As Long
Dim Total As Long
Set dbs = CurrentDb
Set rstOrders = dbs.OpenRecordset("Tbl_Orders")
rstOrders.MoveLast
Total = rstOrders.RecordCount
Total = Total + 1
MyCountRecords = Total
End Function