General :: Can't Update Record
Mar 22, 2013
I've recently come across a problem whilst saving an edited record..I get the following message but only sometimes..could not update currently locked by another session on this machine..Sometimes the record saves without a problem (mainly on the first edit). However, any further edits of the same record mainly but not always triggers the above message. I can't work out why it's happening, It's a split database but I'm the only user on a standalone PC (so no other users editing the same record). Sometimes I get lucky and the record save even after the first edit but not always. There doesn't seem to be any pattern.
Record locks for the form are set to NO LOCKS
Recordset type is set to DYNASET
In settings -
Default open mode it set to SHARED
Default record locking is set to NO LOCKS
Open database by using record-level locking IS CHECKED
This has been working fine for years so I'm a little stumped as to why it should happen now. The only thing I've changed recently is a memo field from Plain text to Rich text.Whilst writing this I just went back and double checked and found that if I change any other field (not the memo field) the record saved just fine. So the problem is to do with the Rich Text memo field only.
View Replies
ADVERTISEMENT
Aug 22, 2013
I have a table called tblCompanies. When a company acquires another company, I need a method by which the acquired company's CompanyID (PK) can be updated to the new company's CompanyID (PK). I also need to be able to update all related CompanyIDs (FKs) to the new value in related tables.
In cases in which the new company does not have an existing record, there is no problem: the company name simply gets changed to the new company and the existing CompanyID is maintained. I then use an audit table and Track Changes function to keep track of the company name data and a union query to keep the old names in the selection lists.
The problem is when both companies already have existing records in the table.
So, let's say I have records for Company A and Company B. Company A merges with Company B and Company B is now the main record. What is the best, simplest and easiest way to update the CompanyID (PK) from A to B and change the CompanyID (FK) to the new value in all related tables?
I am envisioning a pop-up form that directs the user to select the new company and then an update query happens behind the scenes... but exactly how does the criteria for the update query get selected and how do all the related tables get updated? My vba skills are pretty basic, will I need extensive coding to do something like this?
View 6 Replies
View Related
Mar 13, 2014
I have a table called [Tasks] which has the following relevant fields:
[Task ID]
[Location]
I have a form that people use to create new tasks and update current ones. Location on the form is a combo box where people can pick from 5-6 different locations.
What I want:
After someone selects a new location from the combo box and changes the task location, I want to create a new record in a table called [Task Progress] with the [Task ID] of the task whose location was changed, the new [Location], and the [Date] and [Time] it was changed. It would look like
Code:
[Progress ID] [Task ID] [Location] [Date] [Time]
1 5 Station 1 1/1/2011 12:13:01
2 8 Station 2 1/3/2011 01:53:29
3 5 Station 2 1/5/2011 11:13:05
4 5 Station 3 1/6/2011 12:35:22
What should I put in the AfterUpdate event for the [Location] combobox to make the above happen?
Note: All my tables are ODBC linked to SQL Server (can't use data macros).
View 1 Replies
View Related
Apr 3, 2014
I have a create new record from with Employees information taken from tblEmployees. On that form I have a dropdown box of company names taken from tblCompanies. How do I get that to input a ClientID into tblEmployees when I add the new employee? At the moment it just adds a new employee but leaves the ClientID box blank.
View 3 Replies
View Related
Jul 25, 2014
I am having a problem with retrieving the information I am looking for. Basically I am checking to see if a user has selected a TRNumber from a drop down menu and if that TRNumber matches any other records in the table in that field. If it does, is that Number already associated with the user selecting it. If it is I want to get the ID number so I can simply update the record with new information. Here is what I have so far.
Code:
Dim Rs As DAO.Recordset
Dim Tech As String
Dim MsgStr As String
Dim IdMod As String
Set Rs = CurrentDb.OpenRecordset("PrepStartDateBlankQuery")
[Code] .....
View 14 Replies
View Related
Apr 13, 2013
My membership database has worked fine until recently. Now I cannot save inserted data. On attempted saving "Update or CancelUpdate without AddNew or Edit" appears.
The problem. relates to 2 tables Member and Addresses. PK in the parent table Member is ID. In the Addresses Table the FK is ID. There is a One to One relation between the tables and Referential Integrity is set. I know 1 to 1 is not good but it worked fine in this small database.
Browsing the all of the existing records is fine.
View 9 Replies
View Related
Nov 3, 2013
I get an error "update or cancel update without add new or edit" which seems to point to this code.I am using MS Access 2010.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Store when record was last modified and by who.
'Initially stores when the record was entered.
If Me.NewRecord = True Then Exit Sub 'Exit if new record
Me.DateLastModified.Value = Now()
Me.LastModifiedBy.Value = getUser()
End Sub
View 2 Replies
View Related
Jan 26, 2015
i want to be able to create an On Click Event when pushing a command button that will run an Update query to update a record and after it has been updated that specific record will pop up on a Form and be displayed. i know a different way is to run the Update query and then have it displayed in a Select query but i want it to be displayed on a Form instead. is it possible?
View 4 Replies
View Related
Apr 30, 2007
I need a way to dynamically store a particular value in "field_2" of the CURRENT record depending on whether or not the value of "field_1" of the CURRENT record is identical to the value of "field_1" of the PREVIOUS record within the same table. The table is sorted on "field_1".
So, if the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is also "ABC", then store a value of "PPP" in "field_2" of the current record. IF on the other hand, the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is "XYZ", then store a value of "WWW" in "field_2" of the current record.
I have a report that will use these results to count only the number of records that have a "WWW" in "field_2".
Is this doable, maybe in a query somehow?
I should add that whatever the solution, it needs to be compatible with Access 2000.
View 1 Replies
View Related
Feb 6, 2014
I have a database which has a main form and subform built in linked by parent/child customerid, what i would like to do is search all the subform records from the whole DB and return its parent record on the main form?
Can this be done? because if i use find it will only search the filtered form i have onload of the form?
My onload event is based on fosusername()
View 3 Replies
View Related
Feb 1, 2014
I am working on a database and i have notice after making a form that when i enter a record using a form if i enter incomplete data on the form access automatically save that record and generate a id for that record.
For example I have a table that contain
StudentID,StdName,FatherName,DOB,Adress,Phone
And I have created a form for that table that also containing these fields.
Here I want to do that on the form I want a "Save" button , and the purpose of this button that when I click on this button then MS Access Save the record and then generate the ID for that record and if i close my form without pressing "SAVE" button access do not save that incomplete record.
View 10 Replies
View Related
Nov 16, 2014
I have the following script which updates fields in a table.What I am after is a msgbox script to list the ID field value once it is updated.
Code:
Set rec = dbs.OpenRecordset("Select * from Stk_Merge_Delete_Register")
rec.AddNew
rec("StkItemID") = [Forms]![MergeItem]![txtStkFrom]
rec("RackID") = [Forms]![MergeItem]![txtRackFrom]
[code]....
View 3 Replies
View Related
Aug 8, 2012
I'm relatively new to access. I probably use about one tenth of one percent of what it has to offer because I have trouble understanding it at this time. I need to know how to update a yes/no object.
View 2 Replies
View Related
Nov 13, 2012
I need to update a field with a Sum() on event.
View 12 Replies
View Related
Jan 22, 2013
I am working on a DB for work. Currently the form has 3 options, each one selected hides/shows different fields pertaining to that option. Works great when you are putting data into the tables using the form. Problem is when you start that the beginning and click 'next'. When clicking next you do not see the fields show or hide. How do I make this happen?
View 3 Replies
View Related
Apr 8, 2013
In access 2010 if there is a table "log" with
Item Amount
Water 100
Egg 200
and another table "setup" with
Item Amount
Water 20
Egg 50
Can the "setup" be used to update the "log"
Water 80
Egg 150
View 2 Replies
View Related
Aug 1, 2005
Good Day,
I have a record which is updated by customer services dept. for collection of container. Every time we received the collection alert from client we update into system. Sometimes we got more than one collection alert per day. Although the Job No is same but the Date Received the Time Received is different.
Example :
ID Job No Date Time
--------------------------------
1 1000 1-8-2005 8:00
2 1000 1-8-2005 8:30
3 1000 2-8-2005 8:30
4 1001 1-8-2005 9:00
5 1001 1-8-2005 9:30
I just want the last update of data and the result shuld be
ID Job No Date Time
--------------------------------
3 1000 2-8-2005 8:30
5 1001 1-8-2005 9:30
TQ
View 2 Replies
View Related
May 15, 2013
i import data into a Landing table, this will always contain d days woth of data, i then run an apend query into another table were the records are stored up to 20 days, the problem i face is some of the record data may change for eample a field called ShippedQty may be 0 in a monday but on tuesday it may say 5
Import on monday
Product ShippedQty Date
123____ 0 ________01/01/2013
Import on Tuesday
Product ShippedQty Date
123____ 1 ________01/01/2013
I need to look at any changes and updatein the master table, is there a way to do this.(I cannot change the import as its the only way i can get the data)
View 3 Replies
View Related
Mar 1, 2013
I am trying to UPDATE records from the Master form by clicking a button to a new window -
frmCustomerMaster (main form) - a button will trigger to UpdateCustomerMaster new window and pass all the data to the new window.
UpdateCustomerMaster (New window Form) On Submit Update values.
frmCustomerMaster (main form) - is currently locked by properties, I do not want main form to be editable.
how to pass the data to new window and how to update the records?
View 8 Replies
View Related
Mar 3, 2013
I am in the process of updating a database to 2010 (.accdb) and cannot get past a problem. We are using Access 2010.
I updated the back end data to .accdb with no problem. I can't link the front end to that data without updating the front end to .accdb as well. There are no tables in the front end.
I try to update the front end to /accdb and I get the error message 'You are trying to convert an encoded database. Decode the database, then try again.'
How do I decode the database? I tried setting a password and then unsetting it, but that made no difference. I have not previously encoded the database.
can't finish the update to .accdb data. The alternative is to stay with 2003 MDB data. Is that a bad thing?
View 2 Replies
View Related
Jan 13, 2014
I have a simple MyAddress Project. It consists of one main table, a couple of queries, some forms and reports. Most fields in the table are typical text fields. The project allows me to select records from the table and print labels for those selected records. One field is a "yes/no" field. If the field value is true, the label prints; otherwise it does not. I have a form which allows me to scan the list of records and mark those I wish to print. So far so good. I am trying to add two buttons to the form to enable me to 1. Clear All and 2. Check All. I am trying to use an UPDATE statement to activate when I click the appropriate button. However, when I execute, I get the error message "Compile error: Sub or Function not defined".
The name of the table is tblMyAddresses.The firld I am trying to UPDATE is PrtLbl.The update value will be true or false depending on the button clicked. Since I want to change the values in all records, there is no WHERE required. The code I am trying is as follows:
Option Compare Database
Public Sub CheckAll_Click()
Update tblmyaddresses
Set PrtLbl = False
End Sub
View 2 Replies
View Related
Jul 2, 2013
From Excel 2007 to Access 2007 I want to keep my Access database sync with my Excel SpreadSheet. I not to often change Excel but when I do Access will be updated.
Error #: -2147217887
"Field cannot be updated."
My connection string works fine and recordset is up and running!In my Excel file:
Code:
rs.MoveFirst
For k = 1 To Sheets("2013").Cells(Rows.Count, "A").End(xlUp).Row - 4
If rs!Index <> k Or rs!total <> Sheets("2013").Cells(k + 4, 5).Value Then
rs!Index = Sheets("2013").Cells(k + 4, 1).Value
rs!DatePaid = Sheets("2013").Cells(k + 4, 2).Value
rs!WhatPaid = Sheets("2013").Cells(k + 4, 3).Value
[code]...
View 2 Replies
View Related
Oct 31, 2007
Hi,
Don't know if this is possible, or if im being just plain stoopid:
Is there a vb command that will update a record without having to use a query?
My problem is this - I have an HR database which has allows us to add employees that are going to start. We then set their [Activity Status] from "Starting" to "Active". At the moment this is done manually, but what i would like to do is have this automatically change when the [Start Date] = Date().
The code i tried to use (but is obviously wrong) is:
If [Activity Status] = "starting" And [Start Date] < Date Then
Set [Activity Status] = "Active"
End Sub
Any thoughts what i might change "Set" to, to make this work?
Thanks,
Ferg.
View 6 Replies
View Related
Sep 23, 2007
I hope I can convey what I am trying to figure out. I am at a loss right now. I have a form where I input personnel information. One of the fields is for how many months experience they have with the program. What i would like is for this record to update itself every month. for example, if they initially had 2 months experience, I would enter 2. Every month therafter, that number with change to 3, 4, 5...etc. Not everyone comes to our section with the same experience, so most will have a different starting number.
This information would be seen on the personnel form, and in a report to show experience levels. Other than those two, it is not called upon.
Any suggestions would be so helpful!
Thank You!!
View 3 Replies
View Related
Mar 24, 2005
Hello All,
I have a table with over 700 contact records, when I open contact form and select the contact I to want update , it only updates the first row in the table
message "you about to update 1 row(s)"
table set up ContactID is the PK autonumber
please advice
AA
Private Sub Update_Click()
' Dim QrySQL As String
On Error GoTo Err_Handler
DoCmd.RunSQL "Update Contacts " & _
"Set Company = '" & Me.TbxComp & "', " & _
" Street = '" & Me.TbxStreet & "', " & _
" Floor = '" & Me.TbxFloor & "', " & _
" CityStateZip = '" & Me.TbxCityStateZip & "', " & _
" Telephone = '" & Me.Telephone & "', " & _
" Fax = '" & Me.TbxFax & "', " & _
" Manager = '" & Me.TbxAcctMgr & "', " & _
" Email = '" & Me.TbxEmail & "' " & _
"Where ContactName = '" & Me.ContactName & "'"
Err_Handler:
If Err.Number = 2501 Then
Exit Sub
End If
'Else
' MsgBox Err.Description
MsgBox "Update Was Completed !!!"
' DoCmd.SetWarnings False
' DoCmd.RunSQL OrySQL
' DoCmd.SetWarnings True
End Sub
View 14 Replies
View Related
May 25, 2005
Hello all! I'm using a form in data entry mode to add new orders into a table. When the Save button is pressed, an append query posts the order number and date to another table, and then enables a subform for data in that table. The subform is linked to the main form by the order and date to get only the record that was just entered/created.
While the subform does display the desired record, the user cannot update other fields in that table through the subform. I've searched all over the forums, and I'm probably missing something really simple. I've tried turning data entry on and off, changing different subform properties but to no avail. I can filter out the proper record on the subform, I just can't update it! Any help would be much appreciated. Thanks!
View 2 Replies
View Related