Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NO ERROR ON DUP RECORDS AFTER UPDATE

Status
Not open for further replies.

TNN

Programmer
Sep 13, 2000
417
US
Am using Access 2000 database. A SQL constraint clause does not allow duplicate fields on two fields of each record. When I update changes to a recordset with duplicate records I am not getting an error message. However, if I do a MoveNext method after the update then the error message comes up. Why?? and how can I eliminate the need of a MoveNext?? Any help is appreciated.

TNN, Tom
TNPAYROLL@AOL.COM



TOM
 
Robert is correct... the update occurs after the row loses focus...

Tom
 
Lucky guess...that is how it works in Visual FoxPro. Tom S, is there something like a TableUpdate() function that can be called to force an update before the row pointer is moved?

Robert Bradley

 
Thank you Tom & Robert for your response.
The Necessity of a MoveNext after the Update in order to get the required error message is really messing me up. The Update and MoveNext events are in the txtbox Validate event. When MoveNext occurs I am getting the next record displayed in the textbox that I am leaving, meaning the textbox of the Validate event.
Any Help??

Thank You,
TNN Tom
TNPAYROLL@AOL.COM


TOM
 
I'm working with Access 97 rather than 2000 but I'm not sure what you're seeing is an Access problem. When I try creating a duplicate key on a local Access table the error triggers with the cursor pointing to the record which was open for editing.

What you might try, and I'm not in a position to test it, is ".move 0" applied to the recordset. The method's function is to move the cursor 0 rows, but it might force a refresh of the current record over the odbc connection after you apply the .update method.

Best,

Harry Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top