Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 5th, 2005, 05:42 AM
Authorized User
 
Join Date: Jun 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default updating record

I have a bound form and each time the form closes I want to select a group of records and and number then startiing from one. I am using the procedure below but it is not working.

Each time I run the procedure it locks up Access probably because of continuous loop. How do I do this


Dim str As String
    Dim recSet As ADODB.Recordset
    Dim conn As ADODB.Connection
    str = "SELECT tblDelivery.DeliveryID, tblDelivery.DeliveryNumber " & _
    "FROM tblDelivery " & _
    "WHERE tblDelivery.DealershipID = " & [Forms]![frmSwitchboard]![lstDlr]


    Set recSet = New ADODB.Recordset
    Set conn = CurrentProject.Connection
    recSet.Open str, conn, adOpenKeyset, adLockOptimistic, adCmdText

    Do Until recSet.EOF
        recSet!DeliveryNumber = recSet!DeliveryNumber + 1
        recSet.Update
    Loop
 
Old July 5th, 2005, 09:12 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Im not big on ADO right now.. but you dont seem to be moving through your recordset...

recSet.movenext???

Sorry if I am totally off the track with this suggestion!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating database record shrisangeeta Classic ASP Basics 4 February 28th, 2007 05:25 PM
Updating the record in database lwebzem ASP.NET 1.0 and 1.1 Basics 4 March 8th, 2006 09:40 AM
Updating the record in the database lwebzem ASP.NET 1.0 and 1.1 Basics 3 February 28th, 2006 07:57 AM
Updating first found record rtr1900 Classic ASP Databases 9 December 2nd, 2005 03:09 AM
Record not updating Tangerine ASP.NET 1.x and 2.0 Application Design 3 March 24th, 2004 12:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.