473,320 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to Edit Record In Ms Access?

2
I have the following code to edit an existing record.

Expand|Select|Wrap|Line Numbers
  1. If DCount("ID", "AssignLoc", "[ID] = '" & Me.ID & "'") > 0 Then
  2. Set db = CurrentDb
  3. Set rs = db.OpenRecordset("AssignLoc")
  4.                         rs.Edit
  5.                         rs("ID") = Me.ID
  6.                         rs("AssignLoc") = Me.AssignLoc
  7.                         'rs("OWC") = Me.OWC
  8.                         rs("LastUpdate") = Format(Date, "dd-mmm-yy")
  9.                         rs.Update
  10.                         rs.Close
  11.  
When i try to run it, i get message saying that i cannot create duplicate entries. I want to edit not crate a new entry.. How can i fix it?
Dec 2 '10 #1
1 1710
smartchap
236 100+
With the part of the code it seems that you have not used
rs.MoveNext
command to move to next record. Put ur code in a loop and check from first record with
rs.MoveFirst

I hope it will help u.
Dec 4 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Colin Graham | last post by:
I am writing this piece of code to show the previous record on a control on the form but i keep getting the error message "Error 3021 no current record " and the line marked *** gets highlighted. I...
1
by: huzz | last post by:
I have a record in edit the mode inside a repeater (single record), and a update button outside the repeater when i click on the button to update the database i can't access the dropdown list...
1
by: Kamal Ahmed | last post by:
Hi All, I have a datagrid that contains multiple records. I want to edit any record in grid and then Update or Cancel same record. What is short & easy way to do so. TIA.
0
by: MA P | last post by:
Hi! I am currently using MS Access Database on my ASP.NET 2.0 project thru VWD Express. I found that it is running when updating records thru a datagrid view but I want to customize the...
4
by: gary.cobden | last post by:
Hi I have a form/subform where a new record is created on the subform by a button click. After the new record is created, I then need to go directly and display the new record in the subform....
0
by: subrahmanyaam | last post by:
Hi Guys - I am new to vb.net. I just created a form where I can add records and every record has an customer_ID number Now I want to edit a record using the cust_ID Number, how should I do it, Can u...
1
by: alex.gruenther | last post by:
I am new to Access and need help creating an edit record form. I've got a table called Player with attributes like name, address, phone, etc. I've created an edit player form with a combo box...
0
by: AYasser | last post by:
Hi All, I am new to oracle 10g and i am facing the problem of not finding how to edit a record in a table, like using the "table data editor" in oracle 8,9i through the DBA studio. can anyone help...
5
by: Josephine | last post by:
HI experts, I am new in asp.net. I used Visual Studion 2005 and MS Access 2003 to build aspx files. I used the VS 2005 "DetailView" and "GridView" that has INSERT, EDIT, DELETE function. It is...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
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...
0
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...
1
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.