Recordset Locking?

Mar 28, 2006

Hi everyone,

I have a form on which I am unable to enter data. My feeling
is that it is because the recordset is locked (the text areas
are not locked).

Here's the background info:


I have 3 forms and tables that work off of one another.

CustomerInfo
SystemRecord
ServiceHistory

A CustomerInfo record must exist in order to add a SystemRecord record, and both must exist in order to add a Service History record.

Here's the example.

I had a ServiceRecord record and I click on the button to
open the ServiceHistory form to add a record. Since no
record exists, I want the 4 key fields to have values from the ServiceRecord table. So after many tries, this is the
code I came up with:

Private Sub Form_Open(Cancel As Integer)


If IsNull(Me.txtSystemID) Or IsNull(Me.txtCompanyName) Then

Set Conn = CurrentProject.Connection
Set rst = Nothing
rst.Open "ServiceHistory", Conn, adOpenKeyset, adLockOptimistic

rst.AddNew

rst!SrvSystemID = Forms!frmSystemInfo.SysSystemID
rst!SrvCompanyName = Forms!frmSystemInfo.SysCompanyName
rst!SrvSerialNumber = Forms!frmSystemInfo.SysSerialNumber
rst!SrvSystemModel = Forms!frmSystemInfo.SysSystemModel

rst.Update


rst.Save

rst.Close

Me.RecordSource = "qrySystemInfoandSrvHistory"

Else
Me.RecordSource = "qrySystemInfoandSrvHistory"
End If

End Sub

The form opens and all four fields are populated as wanted.
The problem is that all the text fields are then locked. I
tried removing the rst.Close, but that didn't work. I have
a feeling I still have a lock on the record, but don't know how
to get around it. Any ideas?

Thanks as always,

B

View Replies


ADVERTISEMENT

Modules & VBA :: How To Extract Recordset From Subform Into Recordset Object

Aug 14, 2015

Special situation: The SQL Server Linked Server across the country is linked to a Read Only Oracle DB. This data pull works perfectly and populates the Subform.

The problem is that Oracle can take 3 to 6 seconds to retrieve the single record depending on the network traffic through a small pipe.

The code below shows the RecordSource for the SubForm. clicking on a list box supplies the value. Then 3 to 6 seconds later, the subform populates.

The actual Recordset for this Recordsource is needed to conduct Validation on each field. Normally this would be on SQL Server, I might just create a Recordset Oject and run this SQL statement again in 1 milisecond. In this case, it will probably take an additional 3 to 6 seconds. Avoiding another lengthy round-trip to Oracle would be prefered.

Goal: How does one grab, clone, or other wise reference the existing recordset for the SubForm?

Note: Immediate Window - One single field can be returned quickly

There are 48 fields that need validation - is there a way to reference the entire recordset?

Immediate Window during Break Mode:
? me.fsubsrNavSHLBHL("NavSH_QQ")
NESE ' this is the correct value for the current recordsource

Set a breakpoint right after the line:
fsubsrNavSHLBHL.Form.RecordSource = "Select * from vsrNavigatorSHLBHL where Well_ID =" & txtNavWellID.Value

Immediate Window:
? me.fsubsrNavSHLBHL.Form.RecordSource
Select * from vsrNavigatorSHLBHL where Well_ID =91229

View 4 Replies View Related

Does A Filtered Mdb Recordset Still Bring Down The Whole Recordset?

Apr 27, 2007

Hi guys, I'm a bit confused: I know that opening a bound form will bring down the whole recordset. But if I create a parametered query as the recordsource, will it still bring down the whole recordset first and only afterwards cut down to the records matching the parameters?

Example: I have a clients table with 5000 clients on a backend mdb, and my client lookup form in my frontend mdb. If I open the form looking for just client "Jim Jones" (via the parameter query), will Access bring down all 5000 clients from the backend to my frontend first, and only then seek out "Jim Jones" before discarding the rest of the recordset?

For if this is true then this whole Access business is rather unsuited for networks, even a small one. I hope you guys prove me wrong.

Premy

View 14 Replies View Related

Modules & VBA :: Can Use Result Of One Recordset For Other Recordset

Jul 7, 2013

I want to write a email where there are 2 or 3 different ordernumbers for same email, i want to include the email in the mail part as single column table. how to do it? also can i use result of one recordset for other recordset?

View 1 Replies View Related

Create A Recordset From A Recordset

Aug 17, 2007

from a table with fields userID and Date (in which any userID has multiple records with different Date values, and other fields) i have built a select query based on Date = one specific value. can anyone give an explanation (for beginners), through a sample code, that expands the query recordset so that the new recordset includes all records per userID that qualified in the prior recordset? below is an example. thank you!

Table with records:
userID / Date
u1 / d1
u1 / d2
u2 / d1
u2 / d2
u3 / d2
...
1st Select Query (where Date = d1):
u1 / d1
u2 / d1

Desired 2nd Query based off 1st Query (where ?):
u1 / d1
u1 / d2
u2 / d1
u2 / d2

View 3 Replies View Related

Updating One Recordset Using Another Recordset?

Jan 21, 2015

I have two tables that have the exact same fields. In table1 I have records that need to be UPDATED into table2. I tried an Update query and out of 600 records only half of those got updated. In my update query I joined tbl1 and tbl2 by Location (LOC) I checked for Nulls, Blanks, spaces, you name it. I can't figure why they all didn't get updated. I created a SQL query and go the exact same results. Ideally, I would like to create something in VBA to do this. I do not have any forms linked to these tables. In all I have about 600 records and 15 different fields that need to be updated. My example is only for one field.

sql example below. Which is the Access Sql in the Query

sql = "UPDATE tbl2 INNER JOIN tbl1 ON tbl2.LOC = tbl2.LOC" & _
"SET tbl2.Name = tbl1!Name" & _
"WHERE (((tbl2.Name) Is Null));"

Example.

Table1
Field1.Names = John

Table2
Field1.Names = "Need to UPDATE the name 'John' here"

I tried the Recordset .EDIT but I couldn't get it to work using two tables.

View 4 Replies View Related

Locking A Database

May 8, 2005

I have a company wanting to asses my database and i am willing to show them but i need to be able to lock the database so that they can view it but cannot edit anything in it either adding deleting or plan editing. How can i do this.

Bullfrog
The Amateur

View 4 Replies View Related

Split DB, Keeps Locking Up

May 24, 2005

Hi, I just recently split my Access db (FE/BE), copied the FE to each of the clients, and it seemed to be working fine. This morning however, two users went into the db, and the second user kept getting the error can't find the file \servernameshare_namedb_fe.mdb. Now, none of my users can launch it. How can I resolve this? Will this keep happening?

AP

View 1 Replies View Related

Locking Down An .mdb File

Feb 8, 2006

I have to send an access application out to some people who need to preview it's functionality. What is the best way for me to send this .mdb file to them so they can use it (tables, forms, queries, macros and functions) but still keep them from opeing up the objects and viewing the code behind them? Is there a way of sending the .mdb file out so that objects cannot be seen in design mode and the objects cannot be viewed other than through the flow of the application? As you might have already guessed, I am new at securing an .mdb file for outside use. Your help would be greatly appreciated.

Thanks!

View 4 Replies View Related

Complete Locking

Apr 5, 2006

Hello Everyone,

I just migrated a back end to a network server. Now when more than one tries to use the database they get a file in use error.

Any ides?

View 3 Replies View Related

Locking A Invoice

Jan 18, 2007

Hi,

I don't know whether you can help :D But i am in need of some code/guidence, or a way to go about trying to do what i want to achieve.

Basically, i am creating a invoice producing software in Microsoft Access, based upon Computing parts resaleing.

Because the supplier, i use changes the prices daily, when i type the products into the Parts Table, the price being typed in will change for the next customer to have the same part.

Basically because i am using this software to produce Profit and Loss, The invoice will be looking back at the Parts table, and changing the unit costs for invoices which are say weeks old.

I am wondering whether i can "lock" the invoice so it cannot be updated from the Parts list and keep the profit the same, so i get an accruate result when i come to look at it.

I will apprechaite any help or guidance.

Regards

PC_Doctor

View 4 Replies View Related

Locking Down Access '07

Mar 19, 2007

So with the help of many of you on this site, I was able to build my first Access database. Thank you all.

Now that I'm all done, I have one final thing to figure out.

I have incorporated user authentication into the database for a minimal level of security. Everything finally works like it should, however there is one "flaw" I have found.

In "Access Options" I have the login form set to open when the DB is open, and navigation and ribbon/toolbars are deactivated so only the login form and "Home" ribbon are showing when the DB is opened.

The problem with this, is that a curious user that shouldn't have access could get access fairly easily.

If they right clicked the "Home" ribbon, then left clicked "Customize Quick Access Toolbar", they could change the default form to whatever they wanted. Thus bypassing the login form and nullifying any security that it offered. Ideally, there should be no ribbons or toolbars. I just don't know how to get rid of them.

Has anyone else run into this problem?

View 6 Replies View Related

Locking Table

Aug 7, 2007

How Can You Lock Table Or Form So Nobody Can Accidently Delete It Or Alter It Unless Person With Permission?

View 1 Replies View Related

Locking Database

Dec 6, 2007

Hello,

As my username states, I am a rookie to MS Access. I built a database using Access 2002, I will distributed it to other people, I will like to lock changes to certain areas such as forms, design view, etc.

Can this be done? The help is greatly appreciated!

Rookie2007

View 14 Replies View Related

MDE Locking Issue

Jan 15, 2008

I have an Access Front-end that I made into an MDE file. I loaded the MDE onto a server and now there are multiple people accessing the MDE file via shortcuts on their desktop. I noticed since this update went into effect that the MDB file that the MDE file was made from is being locked when people are using the MDE file. I thought I could have made a mistake with one of the shortcuts and that a user was accessing the MDB file instead of the MDE but I had the Network Admin check and no one was in the MDB file at the time it was locked.

I'm wondering if the MDB file should be locked while a user is in the MDE file or if it's a bug?

Thanks,
Michael O'Brien

View 1 Replies View Related

Locking Down Records?

Feb 13, 2008

Is there any way to "lock down" newly created records somehow, so that only the person who created them can edit them after the fact?

Obviously, this would require some kind of system where everyone logged in with some kind of userID and password...and even then, I don't know how such a security system could be set up.

Is this possible? If SO, are there any examples of it anywhere that I could check out?

Thanks in advance!

View 2 Replies View Related

Locking A Record

Mar 14, 2008

is it possible once a record has been entered, to lock it so that it can not be changed by just anyone but that the administrator could change it using a password?

View 6 Replies View Related

Why Is Locking Occuring?

Feb 8, 2005

I have a fixed length .txt which I am linking into a MS Access 2002 d/b.
My options are set to :
default open mode -shared
default record locking - no locks
Open database using record level locking is unchecked
the (datasheet) form is set to:
allow edits/deletions/additions - no
recordset type - snapshot
record locks - no locks
the text box objects are set to:
enabled - no
locked - no

I have no requery actions associated with any events at all.

My problem is that while the form is active I am unable to open the source .txt and if it is already open I cannot save it. There is obviosuly a lock occuring on the .txt object - how can I prevent it occuring?

thanks!

Gordon

View 2 Replies View Related

Locking A Database

Feb 17, 2005

I have looked on the forums and cant quite find what im looking for so i wanted to ask you lot for help.

I have a database i have created.

It will be sent out to people to populate via a series of forms i have created.

How can I lock it down so that:
1) you cant access any of the database apart from the forms
2) Lock it so no one can get in to view the code anywhere or make any amendments to the forms and database what so ever

View 3 Replies View Related

Records Locking

Aug 11, 2005

I update the table through a form.
Each page in the form updates one complete row of the table.

I am trying to find a method to block each row of the table (or equivalenty each record in the form) after completing the entry in order to prevent unwanted deletion or alteration of the entries of this record in the future.
Is this possible?

View 2 Replies View Related

Locking A Combo-box

May 3, 2006

If you have a combo-box that is limited to values in a list, how do you set it up so that the user is not able to input into the field but still able to select from the drop-down??

Is this possible, if so how?...please


Cheers

View 4 Replies View Related

Locking Records?

Sep 30, 2006

I’m new to access but I have created a table with a form linked to it. It shows one record per page. I just want to be able to lock and unlock individual records in the form by using a checkbox. This will prevent me from accidently making a change to an old record.

For example, when the checkbox is unchecked. the current record on the form can still be edited. When the checkbox is checked, the record can only be viewed, not edited. I still need to be able to navigate through the locked record and create a duplicate from the locked record though. Does anyone know a simple way to do this? My guess that it has to do with the AfterUpdate event? Thanks for any help.

Dale

View 14 Replies View Related

Table Locking

Dec 18, 2006

I have a single table app with a form. The form pretty much just displays the data that is in the table in a more user friendly view. Right now when a user enters data into the form it automatically adds it to the table. What I want is for the table to not be updated until the user clicks a Save button. Can anyone tell me how to do this?

View 4 Replies View Related

Locking Record

Dec 19, 2006

Had a good look at previous posts but couldn't find exactly what I am after.
Having entered a record I don't want users to go back and edit/amend the input. I can see how to lock and unlock records but controlling this wilt say a checkbox also means any user can 'uncheck' and edit. Is there a method to restrict who can unlock ('uncheck') and edit a record, other than using Access Security permissions.
Thanks
RussG

View 3 Replies View Related

Website .mdb Locking Up

Nov 18, 2004

I am having a problem with locking, and it is crashing our website.
I suspect it is a locking problem because everytime the database goes down, I ftp into the site and see the dreaded *.ldb file.
Access is suspose to support from 15 to 20 concurrent users, right? The log files show no more than two or three users accessing the database at the same time. By "same time" I mean within one second.

Below is the code which updates the database. Can anyone see anything wrong with this?

Also, if I wrote the information to a text file with the FileSystemObject instead to Access, would I solve the problem of locking?

BEGIN CODE -----------------

sub OpenDB(sConn)
'Opens the given connection and initializes the recordset
conn.open sConn
set rs.ActiveConnection = conn
rs.CursorType = adOpenStatic
end sub


OpenDB sConnStats

'Get ID's by Names
lIdOS = GetIdOS(sOS)
lIdColor = GetIdColor(sColor)
lIdBrowser = GetIdBrowser(sBrowser)
lIdPath = GetIdPath(sPath)
lIdRef = GetIdRef(sReferer)
lIdRes = GetIdRes(sResolution)

sSQL = "SELECT * FROM Stats"
rs.Open sSQL,,,adCmdTable

'Save the data
rs.AddNew
rs("OsID") = lIdOS
rs("ColorID") = lIdColor
rs("BrowserID") = lIdBrowser
rs("PathID") = lIdPath
rs("RefID") = lIdRef
rs("ResID") = lIdRes
rs("Date") = date
rs("Time") = time
rs("IP") = sIP
rs.Update

'Terminate database connection
CloseDB

View 1 Replies View Related

Locking Records

Jan 13, 2005

anyone know about this? i've messed with it, but i think i screwed it up. when one user is using a record and another tries to access it, my program shuts down completely.

View 1 Replies View Related







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