-
vb beginner needs help with process
Here's my code (MS Access 97):
Sub imagetag()
On Error goto imagetag_err
Docmd.Opentable "table1", acNormal, acEdit
Dim x as integer
for x = 1 to 10
DoCmd.FindRecord "TO********", acStart, False, acDown, False,,False
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "Field21"
DOCmd.RunCommand acCmdPaste
DoCmd.GoToRecord ,, acNext
DoCmd.GoToControl "field1"
Next x
imagetag_exit:
Exit sub
Imagetatg_err:
MsgBox Error$
Resume imagetag_exit
End Sub
My intention is to copy the first 10 characters (of 23) from field1 and paste
into field21.
I need it to repeat the process any number of times (e.g. 2500)
I thought that the above code would move to the next record and repeat the
find/copy/paste, but it
only does it for the first record then gives the following error:
The RunCommand Action was Cancelled
You used a method of the DoCmd object to carry out an action
in VB, but then clicked cancel in a dialog box.
I've also used a Do loop but get the same results. How do I get it
to do it 10X (or 2500X)? Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks