Trouble With Code When Record Is Locked

May 8, 2005

I'm going live with my DB tomorrow morning. I wanted to to Edited Records for my lock type but ran into a problem, this weekend when I took it to our office and had it on multiple computers for the first time. (I've been designing at my house, in my spare time (right), so I couldn't test for the problem I have now.) When a user is on a record and I open the same record up on another computer it locks ok and shows in the Record Selector that it's locked but if I begin to tab through the form I have at least one code that pukes. In my LastName field, in the On Exit event, I have the following code:
If Not (IsNull(Me.LastName)) Then
Me.LastName = StrConv(Me.LastName, vbProperCase)
End If
As I try to Exit this field, only when the record is locked, the code pukes. Can some one lend a hand and give some advise on how to prevent this?

Thanks ahead of time,
Shane

View Replies


ADVERTISEMENT

Please Help: Password Locked VBA Code! I'm Desperate...

Oct 6, 2005

Hi,

I really hope somebody can help me... I put a password on the VBA code in an Access 2000 database. It's been a long time ago and now I have forgotten the password. I need to modify something urgent in that code, but it is locked now. I don't know the password anymore.

Is there some way to gain access to the VBA code again???
Please if you know a solution I would be very thankful!

:(

View 2 Replies View Related

Trouble With Code In Query

Jun 12, 2007

I am having trouble with some code I am using on a query. Part of the query comes from two fields in a form. The rest comes from a table. The query then populates a report. The code I have written works fine. The trouble starts when I try and enter in some code so that if some of the fields in the form is left blank, it just returns values based on the fileds that has data, so ignores any blank fields.
I have tried to use examples illustrated in this Forum, but it does not seem to like it. I keep on getting the request to fill in the parameter value. I am sure it is something simple!

This is the code I have entered for the Invoice Date Field:
Between [Forms]![Invoices]![Invoice date 1] And [Forms]![Invoices]![Invoice date 2]
(this is so the user can enter a date range with the two fields)

View 14 Replies View Related

Table Locked When Trying To Update Via Code Called By A Form

Oct 19, 2005

:eek: :eek: :eek: :eek: :eek: :confused: :confused: :confused:

I am trying to update a database table via a command button on the main form, that uses tabbed sub forms.

The database gets its data from paradox data tables copied our company's
third-party software. These table files are copied from one location to another to stop the paradox database from locking up and giving me errors during the import process of this database. I then link to these files at a pre-determined location on a local computer hard drive.

When I try to run the code below I get the error about the table being
locked by a user or process. As you can see I have tried adding a pause
incase the files are still being copied but this does not seem to be the
problem.

I have used a msg box to confirm that the copying process has completed before starting the make query, but the same error comes up after I click ok.

Can anyone suggest anything else.

As you can see from the simplicity of the code below I am a beginner so take it easy on me, by not taking knowledge for granted. :)

code:
------------------------------------------------------------

Dim response
Dim stDocName As String
Dim stLinkCriteria As String


response = MsgBox("Are you sure that you want to update xxx with Customer
data from xxx?", vbYesNo, "Perform Update")
If response = vbYes Then

‘pause software to let any pending work to be completed
Sleep (5000)

‘close active form
DoCmd.Close

‘close all active forms
Do While Forms.Count > 0
DoCmd.Close acForm, Forms(0).Name
Loop

‘pause software to let any pending work to be completed
Sleep (30000)

‘delete existing file
Kill "c:folderfile DATA.DB"

‘replace with new file
FileCopy "J:Folderew_DATA.DB", " c:folderfile DATA.DB "

‘pause software to let any pending work to be completed
Sleep (40000)

DoCmd.SetWarnings False


stDocName = "Make_DATA"
DoCmd.OpenQuery stDocName, acNormal, acEdit

‘pause software to let any pending work to be completed
Sleep (35000)

stDocName = "Make_DATA_SUMMARY"
DoCmd.OpenQuery stDocName, acNormal, acEdit

‘pause software to let any pending work to be completed
Sleep (35000)

stDocName = "qry_Update_ Status"
DoCmd.OpenQuery stDocName, acNormal, acEdit

‘pause software to let any pending work to be completed
Sleep (35000)

‘open up main form when finsihed
stDocName = "main-form"
DoCmd.OpenForm stDocName, , , stLinkCriteria

DoCmd.SetWarnings True


Else
End If

View 3 Replies View Related

Having Trouble In Executing TreeCtrl Code

Jul 11, 2006

Hi,

I am having trouble in implementing the TreeCtrl structure. I have a simple database for testing purpose and I am not able to make it work. There appears to be a problem with the bookmark property and I get an error message:
"can't Add child:Arguments are of wrong Type, are out of acceptable range, or are in conflict with one another".

I have attached the database here and could you please see what is wrong with my code.


Thanks
Priya

View 5 Replies View Related

Show Who Has A Record Locked??

Sep 28, 2005

First of all hi everyone, im lookin for some advice

i have database setup with record level locking for multiple users (havent decided weather its should be optimstic or pesimistic yet)

however either way i set this there is no idication that the record is opened/locked by another user is there an easy way to say pop up a msgbox when a user enters a record to say this is in use/locked and show who by using the username?

Thanks
:)

View 1 Replies View Related

Record Locked In Multiuser Environment

Jun 3, 2006

hi,
am trying to create an application for a company that has a small call-center (strength 20). the db is in the central server and each caller sits with frontend on their computer.
the central DB is shared on the network which these 20 PCs are accessing.

The frontend: 1 Form only which is based on a query that displays records.
Form Lock property: Edited Records
Query Property: Edited Records

As the telecaller starts calling the customer looking at the records, they are not able to edit certain records as the respective record is locked by MS-Access when am sure that no other telecaller has opened the particular record.

Any help is appreciated.

Prodigy.

View 3 Replies View Related

Multiple User Receiving Record Locked

Oct 10, 2006

Hello,

I have a database we use to enter new account numbers and several other atribbutes about the account and it is split into a FE/BE with the BE in a shared folder. I have the open database using record-level locking checked but it seems to me that the database is opening up with page-level locking. Multiple users will receive a message that the current record is locked and I am sure that they are all not updating the same record. Does anybody have any idea's of what I can do? If nothing else I am going to have to recreate my form as an unbound form and see how that goes.

View 14 Replies View Related

How To Create A Message Box Indicating Record Is Locked?

May 1, 2006

I have done some serious searching and have discovered that many others have posted this question, but I couldn't find any satisfactory answers.

I have a FE/BE Access 2000 database in a multi-user environment. I have my default record locking set to "No Locks" (optimistic), but for unknown reasons, some records still lock. The records are viewed via a form, which is also set to "No Locks." We only have about 20 users, so it is rare that two people actually have the same record open at the same time. It seems to be that whole groups of records lock sometimes, despite the fact that I'm using optimistic record locking. Usually if you wait 15-20 minutes it is unlocked. If someone can explain this I would be overjoyed.

But, I can deal with the record locking. The problem is that users have no idea why they can't update a record and no matter how many times I tell them to wait 15 minutes they still come crying to me every time. So, I want to make a message box pop up when they try to update the record that states something like this: "The record is currently locked. Please try again in 15-20 minutes."

If someone could offer some code options and explain where it needs to go (form load, open, etc.) I would be eternally grateful.

Thank you!

View 6 Replies View Related

Trouble Getting The Last Record

May 16, 2005

Hey, I have a query to calculate the stock balances and their values.....the client is using FIFO method...therefore, the stock may have different values at different stage......but they want to display the latest unit price in the report.......I selected "Last" at the UPrice column in the query, but the query doesn't give me the value I want.....

e.g.

Date In Out UPrice
03/12/05 12 0 22.00
03/14/05 0 12 22.00
03/15/05 15 0 24.50

In this example, the report should displays 24.50, but it displayed 22.00.....
can someone point to me where I have made the mistake?? Thank you

View 1 Replies View Related

Help! Having Trouble Editing A Record Using A Form

Aug 17, 2006

Dear access experts,

I created form based on a query of around 7 tables, all the fields are set to
enabled and edits are allowed; however, access wont allow me to edit any of
the fields in that form! I know that the query is correct because i can flick
through the records and the fileds change.. please help:eek:

View 2 Replies View Related

Forms :: Condition A Field To Locked On 1 Record Of Continuous Form Subfile

Jun 1, 2015

Access 2002 . Can I condition a field to 'locked' on just one record of a continuous form subfile, based on the contents of a 2nd field in same record?

View 14 Replies View Related

How Can I Add Record Using DAO Code

Aug 23, 2005

Could you please let me know how can i add record using DAO code.

Dim db As DAO.Database
Set db = currentdb
..........
.......

View 3 Replies View Related

Add New Record Code

Sep 9, 2005

First off let me say there is some terrific info here on this site, great job! Also, let me state that I'm designing my first database so I'll likely be asking some really stupid questions.

I'm designing a database which will allow customer work orders to be entered. The main form is pretty big but it requires a lot of info. Eventually I want to add a search option that will allow the user to search for all records for a specific customer, or address.

Anyway, I had an Add Record button working but it was causing other problems so I had somebody help me out but now I have problems with what they added to the add record button. If some of the required fields are not filled out there is no action when the add record button is pushed. I was getting into an endless loop because the "Resume" command was in the code so I took it out. Can anybody help me with this please?

Here's the code on the Add Record button:

Private Sub addnew_Click()

On Error GoTo Err_addnew_Click

DoCmd.GoToRecord , , acNewRec

Exit_addnew_Click:

MsgBox "customer added", vbOKOnly, App.Title
Exit Sub

Err_addnew_Click:
MsgBox Err.Description
Exit_addnew_Click

End Sub

View 12 Replies View Related

Trying To Delete A Record With Code

Dec 11, 2005

Why does this code not delete the current record?

DoCmd.RunSQL "DELETE * FROM [Tble-Readings]WHERE
[Tble-Readings].[ID]= " & Me![ID] & ";"

I have this code on the a Close Button and if the record is incomplete I want it to be deleted from the table. The ID field is an autonumber so it is the 1st field to get a value if a user starts entering data. I get a msg box saying 0 fileds will be deleted why? the id's do match but it does not delete??

jon

View 5 Replies View Related

Previous / Next Record Code

Jun 23, 2005

Ive added my own navigation buttons as I needed to add some code to them, but when a user gets to the first / last records & presses previous / next record, they get an error message 'cannot go to the specified record' and have to close & reopen the form.
It's prob. quite simple, but how do I get round this please?

View 4 Replies View Related

Vb Code For Saving A Record

Feb 22, 2006

Hi,

This should be an easy one...I would like to save a record part-way while filling out a form. I know this can be accomplished by pressing Shift+Enter, but does anyone know the vb code for saving a record while working on a form?

Thanks.

View 1 Replies View Related

Apply Code For Each Record

Aug 19, 2004

I have a form where people can enter multiple records. In a command button on that form I have code that assigns a unique identifier for the record. Unfortunately I am getting an error and I think it is b/c the code is not running for each record. Is there a way to tell the code to run once for each record?

THX!

View 1 Replies View Related

Vba Code For Saving A Record

Apr 13, 2006

hola,

does anyone know the code to save a report with a changing file name?

here are the details.
i have a reoprt that changes weekly. i want to save a weekly file with the end result to be called "Downtime Cost Report #/##/##", where the date is pulled in from a qry called "qry_Actual_Costs_Thru" and field name [Fiscal Week].

i know it is something like:

DoCmd.Save acReport, "Downtime Cost Report"

Thanks
T

View 4 Replies View Related

Use Code To Determine If A Record Is On A Query Or Not

Jun 6, 2007

I have a form that shows employee license information. I also have a query & form based on that query to show licenses currently suspended. I would like to on my employees form to flash "license suspended" label if their name/record id is on the license suspension query. For all employees whose license isn't suspensed I would don't want anything to show. I can get the label to flash and to appear. I just need help evaluating the query and comparing it to the current record. Example I

if me.id = queryname.id then....execute label flashing, etc.

Can I write code to do this? Thank you

View 4 Replies View Related

How To Add A New Record In A Table By Code Or Macro?

Nov 8, 2007

I have a simple table of Customer names. It's as simple as two fields involved:

CustomerID
CustomerName

How can I use VBA code or macro to add a new record to this table? I'm a newbie, so if possible, please provide a few lines of example codes. Thanks.

View 6 Replies View Related

Escape From A Record Entry Using Code

Feb 2, 2005

Hi,

I would like to be able to abort a record input using code rather than the esc key on the keyboard.

Is this possible, if so can anyone help with the correct code or method etc.

Sue

View 1 Replies View Related

Cycling Thru Record In A Query In Code

Jun 12, 2005

I'm trying to set up a looping code to go thru each record in a query. I know in excel I would set the cell value to a range and offset to get to the next value. How is this done in Access?

View 1 Replies View Related

Code For Adding A New Record On A Form

Aug 23, 2004

Is there code that will add a new record? I was told that the code that I am using does not actually add a new record to my form.
Here is my code:

Private Sub cmdNew_Click()

On Error GoTo Err_Ctl_New_RMA_Click
On Error GoTo Err_Ctl_New_RMA_Click

DoCmd.GoToRecord , , acNewRec

Exit_Ctl_New_RMA_Click:
Exit Sub
Err_Ctl_New_RMA_Click:
MsgBox Err.Description
Resume Exit_Ctl_New_RMA_Click

End Sub
DoCmd.GoToRecord , , acNewRec

Exit_Ctl_New_RMA_Click:
Exit Sub
Err_Ctl_New_RMA_Click:
MsgBox Err.Description
Resume Exit_Ctl_New_RMA_Click

End Sub

View 2 Replies View Related

VBA Code Problem To Verify Record

May 31, 2006

Hello,
I need some help. I have a form named MASTER based on a table also called MASTER.
A control of my form in names SSN which stores the client SSN.

On the same form I have placed a subform which has its record source to a table named 21.

What I am trying to do is:
When I enter a new record in my form MASTER, the code should:
1) Verify if in table 21 a record with that SSN already exists.
If YES, skip the code and do not add the SSN. If NO, well, run the appendquery.

2) At the same time, verify if a record with that SSN already exists in table MASTER. If NO, add the data, if YES, abort the code and exit the form.

The form EForms is a menu form I use to access the records.


This is the code. Something is not going right, I think with the end if functions. Any help? I have placed the code in the AfterUpdate event of my control SSN.

Dim mydb As DAO.Database, MyRs As DAO.Recordset
Dim strCode As String
Dim strFilter As String
Dim stDocName As String
Dim stLinkCriteria As String

Set mydb = CurrentDb
Set MyRs = mydb.OpenRecordset("master")

stDocName = "MASTER"

stLinkCriteria = "[SSN]=" & "'" & Me![SSN] & "'"



DoCmd.OpenForm stDocName, , , stLinkCriteria

If Not IsNull(DLookup("[SSN]", "21", "[SSN] = '" & Me!SSN & "'")) Then
Forms("EFORMS").Visible = False
Else
If IsNull(DLookup("[SSN]", "21", "[SSN] = '" & Me!SSN & "'")) Then
DoCmd.OpenQuery ("Appendssa21tax")
End If
End If

If Not IsNull(DLookup("[SSN]", "MASTER", "[SSN] = '" & Me!SSN & "'")) Then
MsgBox "Sorry! A record with this SSN is already in file. Retrive case from E-Forms Menu.", vbOKOnly, "Warning"
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
End If
Forms!eforms.lstPreInterview.Value = Null
DoCmd.Close
DoCmd.OpenForm ("Eforms")
DoCmd.RunMacro ("CloseEforms")
DoCmd.OpenForm ("Eforms")
End If

Thanks.

View 1 Replies View Related

Modules & VBA :: Code To Take To A Duplicate Record

Aug 13, 2013

I have a form based on a query and have written code to display a msgbox if a duplicate entry is inputted in the NHS_Number field in the form. I have also added code "me.undo" to clear the form so that it is not saved. I am looking for a piece of code that will display the duplicate record. Here is my code thus far:

Private Sub NHs_Number_BeforeUpdate(Cancel As Integer)
Dim dbs As Database
Dim rst As DAO.Recordset
Dim x As Integer

[Code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved