Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 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 May 31st, 2006, 03:42 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default "you canceled the previous operation" error

Code:

var = DLookup("[id]", "[Activity_Log]", "[id] = " & Forms![Activity_Logs]![cbWeek])

Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone

rs.Find "id = " & var
Me.Bookmark = rs.Bookmark


I keep getting that error at the line which says "Me.Bookmark = rs.Bookmark"

What is wrong?

Thanks

 
Old June 1st, 2006, 07:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Try

Dim rs As Object, var as Variant

var = DLookUp("[id]", "Activity_Log", "[id] = " & Me.cbWeek)

If Not IsNull(var) Then
    Set rs = Me.Recordset.Clone
    rs.Find "id = " & var

    If Not rs.EOF Then
        Me.Bookmark = rs.Bookmark
    End If

    Set rs = Nothing
End If


The Me is just a shortcut for Forms![Activity_Logs] if your code is within that form.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old June 14th, 2006, 02:48 PM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for replying but I still get the same error on that line in your code. What's the cause of this?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupt DB - You cancelled the previous operation timmaher Access 8 June 5th, 2008 05:12 AM
Error 2001 You canceled the previous operation RayL Access VBA 3 December 8th, 2006 03:00 PM
you canceled the previous operation lizhaskin Access 1 July 19th, 2005 12:36 PM
Error 2001: You canceled the previous operation RayL Access VBA 3 May 27th, 2005 07:40 AM
Operation must use an updateable query error bnlmike Classic ASP Databases 1 July 16th, 2003 04:21 AM





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