I have a continuous bound form on a FE stored on desktop of each user PC. The BE sits on a local network drive.
I have the default record locking to "No Locks" and Open Database Using Record Level locking.
All appears to work well, but periodically (several times a day) a user will get the message "Could not update; currently locked" (no error number).
This error seems to only occur as the first character of the new record is entered. There are several fields defaulted to equal to some unbound fields on the same form (see attached screen shot - though it is not clear due to screen resolution, this form is a tab control).
When the error is cleared (hit OK) the first character will appear in the appropriate field, but the Date field (supposed to be defaulted) is always blank - though other defaulted fields remain. Also, while the error message is display, the word "Calculating..." appears in the bottom left of screen. Am I interrupting the saving?
What could possibly be happening? How can I fix and/or capture and handle the error?
(I had some OnCurrent code to sync another subform on the same tab - error appears to continue even with code removed).
Thank you.
6 24251
Hmm, found http://bytes.com/topic/access/answer...rrently-locked indicating it might be the access page lock that's causing this trouble.
Personally I don't have this "trouble" as I never insert records using the "New" record row. I force an insert by code and the user has to press OK or Cancel to continue. Thus the [Cancel] is used to delete the inserted row and as an additional feature I create my own unique ID using the DMAX() function.
Is this a possible solution for you too ?
Nic;o)
I have researched a lot about page and record locking, and I think I have my setup correct. Rewritting the database to work in an entirely different fashion is a possibility, but I like how this database currently works (when it works - which is 99% of the time) - wondering if I can find a true solution.
Is there something to do with multiple default fields? - given the behaviour I described in the original post.
I have indexed a number of fields - could that be a problem? Can you confict with the database trying to still save the last record, and update indexes etc. while quickly entering a new record?
Goto the form. Add an event procedure to the OnError - Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
MsgBox "Error Occured, ErrNr:" & DataErr
-
End Sub
That will give you the error number. Why Access doesn't always spit out the error number is beyond me....
Lets presume the error is 3041, you can then handle it with code like: - Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
If DataErr = 3041 Then
-
Response = acDataErrContinue
-
End If
-
End Sub
The acDataErrContinue basicly means I dont care, lets proceed anyways (Probably not recomended). You can also try other methods to handle when this error occurs if you find the "real" problem. Note that all errors that are not 3041 will be shown normally (No worries, your not suppressing any other errors by adding this code.)
The only other true solution I know is working with a form with only unbound fields and insert-update the data by code. This is however a lot more work than the INSERT before approach I described...
Nic;o)
Some good info guys. I will try capturing the error, and see what I can do with it.
I have begun building the completly upbound solution - but agree, it is a lot of work, and not as slick to the end user as my current solution. My current screen filters for date, shift and associate. How do I go about implementing your INSERT with code in this example, with a continuous form.
I would also like to try and understand what is going wrong here. Any one know an anwer to my other questions? Is there something to do with multiple default fields? - given the behaviour I described in the original post.
I have indexed a number of fields - could that be a problem? Can you confict with the database trying to still save the last record, and update indexes etc. while quickly entering a new record?
Basically you'll need to add an Insert button on the main form and set the "AllowAdditions" in the subform to "No".
I've attached a working sample based on this principle, but also based on the ObjectAction model. That implies that the datasheet subform is for filtering and sorting and that the New/Update/Delete/etc. actions are handled by a different form.
Notice that the table holds a number and no autonumber.
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brian Maupin |
last post by:
I have a refreshing webcam shot on my site and I was wondering if
there was a way I could display how many people are currently viewing
it?
Thanks in advance.
|
by: Andrew Donnelly |
last post by:
I am trying to update a memo field in a table from a form that I have
created. The form is unbound, and once the user makes their changes,
they have to click the continue button. Once the button...
|
by: David W. Fenton |
last post by:
A very old app of mine that's been in production use, and largely
unchanged since about 1998 has started recently throwing error 3188
(can't update, locked by another session on this machine) when...
|
by: Daniel Billingsley |
last post by:
I've got a project I've been working on for a few weeks. I've been using
the BindingSource control - I've got four of them on this particular form.
This morning I went to view the report in the...
|
by: amindi |
last post by:
Hi,
I wrote a VB6 program to read some data records from a Ms Access database and to write them into a SQL server database.(I use Ms Access 2000 and SQL server 2000).After reading each record in...
|
by: CWogksch |
last post by:
Hello, Everyone...
My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
|
by: CWogksch |
last post by:
Hello, Everyone...
My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
|
by: Chuckk Hubbard |
last post by:
The docs say to try to discover the URI on my own if this happens.
Could I get a hand doing that?
This isn't just something I want to solve on my machine, e.g. by
changing my network setup or what...
|
by: Chuckk Hubbard |
last post by:
OK, I think I have it. The Manual says to start a Name Server "using
the ns command", and I figured out that means using the pyro-ns
script.
On Mon, Nov 10, 2008 at 10:49 AM, Chuckk Hubbard...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |