473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem with locked records

Hey guys,
i'm kinda new with access, despite having worked with it all
summer. I'm getting an error with a vba function i wrote to take some
information from an access form and put it into a bunch of tables in
an access database. if i insert a bunch of break points and slowly
walk through everything there is no problem. But if i just run it i
get an error about trying to access a record that is locked by another
user i believe. It seems to mostly occur in a part of the function
that is a while loop that looks something like this
While Not IsNull(assetArr(currindex, CurrAccIndex))
Me.lstPOacc.BoundColumn = 1
CurrAccCLIN = Me.lstPOacc.ItemData(CurrAccIndex)
Me.lstPOacc.BoundColumn = 2
currAccPrice = Me.lstPOacc.ItemData(CurrAccIndex)

'Open recordset
With rs1
Set .ActiveConnection = conn
.Source = "accessory"
.LockType = adLockOptimistic
.Open
End With

rs1.AddNew
rs1("accCLIN") = CurrAccCLIN
rs1("dateAdded") = Me.txtPoPstart
rs1("assetKey") = currAssetKey
rs1.Update
currAccKey = rs1.Fields("AccID")
rs1.Close

'add info to rel acc form
strSQL = "INSERT INTO rel_acc_form (AccID,FormID,cost)
VALUES (" & _
"currAccKey & "," & currformid & "," &
currAccPrice & ");"
DoCmd.RunSQL (strSQL)

CurrAccIndex = CurrAccIndex + 1
Wend

but i think it may be happening in other places in the function as
well. Is access not finishing releasing a record before it tries to
use it again? is there something obvious i'm missing...sorry about
the weak code, i've been in kinda a rush.
thanks for any help you can give me,
Keith
Nov 13 '05 #1
0 1036

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1218
by: Ryan | last post by:
I have an SP which I use to insert into a table data from another. For example... INSERT INTO myWorkTable (Field1, Field2) SELECT myField1, myField2 FROM
3
1903
by: Oren | last post by:
Hi, I have an Access application with linked tables via ODBC to MSSQL server 2000. Having a weird problem, probably something i've done while not being aware of (kinda newbie). the last 20...
5
5996
by: David C. Barber | last post by:
I'm trying to determine which user has locked a given record from VB6. I know I can use sp_lock and sp_who, and match up the data to determine which users have locked records in my database,...
5
5445
by: Ritesh | last post by:
Hi All, According to my observation using SP_WHO2 in my database, some INSERT statements are getting blocked by SELECT statements. Though the blocking SELECT statement is having ReadPast hint,...
0
2202
by: surotkin | last post by:
Hi all! My code is causing a violation against the MaxLocksPerFile in the registry. I checked Microsoft Knowledge Base http://support.microsoft.com/default.aspx?scid=kb;EN-US;815281. It...
3
2158
by: jamesgrady via AccessMonster.com | last post by:
Guys, I created a database about 2 years ago with about 30 tables and 60 queries, with a bunch of forms, and macros, and a whole heap of a lot of VB code. It was worked excellent until...
2
2766
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5...
6
4484
by: ljstern | last post by:
Hello. I am using MS Access 2003 with XP/pro. I have a form that has the following properties set through the property sheet: form: AllowAdditions = False CartridgeID field: Locked = True ...
6
11306
by: stuart | last post by:
I have 2 users who ran into a problem with a data entry program (written in Access 2003). One user was keying into one of the forms when she got the message "ACCESS Error Number: 3218 Could not...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.