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 VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 Search this Thread Display Modes
  #1 (permalink)  
Old November 17th, 2011, 03:40 PM
Authorized User
Points: 102, Level: 2
Points: 102, Level: 2 Points: 102, Level: 2 Points: 102, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default Run Time Error - 3052

I have a module that is creating a Run Time Error.

Code:
Public Sub TrimZeroesPayments()

Dim rec As DAO.Recordset
Dim lngLoop As Long
Dim lngCount As Long
Dim strData As String
Dim strTemp As String

Set rec = CurrentDb.OpenRecordset("TblAllPayments-History")
rec.MoveLast
rec.MoveFirst
lngCount = rec.RecordCount
For lngLoop = 1 To lngCount
strData = rec("Invoice Number")
strTemp = Left(strData, 1)
Do While strTemp = "0"
strData = Mid(strData, 2)
strTemp = Left(strData, 1)
Loop
rec.Edit
rec("Invoice Number") = strData
rec.Update
rec.MoveNext
Next lngLoop
Set rec = Nothing

End Sub
This database has been working for a few months, this is the first of this error to my knowledge. It breaks at the "Rec.Edit" portion of the code.

Any suggestions?

Last edited by SunnySide; November 17th, 2011 at 03:48 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error(s) Chacko C++ Programming 0 March 4th, 2007 02:28 PM
run time error ashishroyk Java GUI 0 October 8th, 2004 01:42 AM
Run Time Error JBond Access VBA 0 May 27th, 2004 09:50 AM
RUN-TIME ERROR compcad Beginning VB 6 2 May 21st, 2004 02:01 AM



All times are GMT -4. The time now is 01:34 PM.


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