Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 5th, 2005, 05:42 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old July 5th, 2005, 09:12 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
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!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 08:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.