Problems with code when converting database to Access2000 from Access97 
Author Message
 Problems with code when converting database to Access2000 from Access97

Can anybody tell me why this code doesn't work in Access2000 after I
converted the database from Access97?

When this code runs in Access2000, I get an "Update or Cancel Update without
AddNew or edit".  It works just fine in Access97.

Private Sub Command87_Click()
On Error GoTo Err_Command87_Click

    Dim stDocName As String
    Dim db As Database
    Dim rstRFP As Recordset

    Set db = CurrentDb()
    Set rstRFP = db.OpenRecordset("HBERFP", DB_OPEN_DYNASET)
    With rstRFP
        .AddNew
        ![ClientID] = "MCKHBOC00"
        ![PROPCODE] = Me!PROPCODE
        .Bookmark = rstRFP.LastModified
        .Update
    End With

Thanks for your help!



Sun, 11 Aug 2002 03:00:00 GMT  
 Problems with code when converting database to Access2000 from Access97
Try moving the .Bookmark statement after the Update method.
----



Quote:
> Can anybody tell me why this code doesn't work in Access2000 after I
> converted the database from Access97?

> When this code runs in Access2000, I get an "Update or Cancel Update
without
> AddNew or edit".  It works just fine in Access97.

> Private Sub Command87_Click()
> On Error GoTo Err_Command87_Click

>     Dim stDocName As String
>     Dim db As Database
>     Dim rstRFP As Recordset

>     Set db = CurrentDb()
>     Set rstRFP = db.OpenRecordset("HBERFP", DB_OPEN_DYNASET)
>     With rstRFP
>         .AddNew
>         ![ClientID] = "MCKHBOC00"
>         ![PROPCODE] = Me!PROPCODE
>         .Bookmark = rstRFP.LastModified
>         .Update
>     End With

> Thanks for your help!

--
++++++++++++++++++++++++++++++++++++++++
Check it:
O.o. H.N.N. o.O.: http://hackernews.com

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 11 Aug 2002 03:00:00 GMT  
 Problems with code when converting database to Access2000 from Access97
Take a look at this article about needing to do DAO referencing in Access
2000

http://support.microsoft.com/support/kb/articles/q199/0/64.asp

Dick

Quote:

>Can anybody tell me why this code doesn't work in Access2000 after I
>converted the database from Access97?

>When this code runs in Access2000, I get an "Update or Cancel Update
without
>AddNew or edit".  It works just fine in Access97.

>Private Sub Command87_Click()
>On Error GoTo Err_Command87_Click

>    Dim stDocName As String
>    Dim db As Database
>    Dim rstRFP As Recordset

>    Set db = CurrentDb()
>    Set rstRFP = db.OpenRecordset("HBERFP", DB_OPEN_DYNASET)
>    With rstRFP
>        .AddNew
>        ![ClientID] = "MCKHBOC00"
>        ![PROPCODE] = Me!PROPCODE
>        .Bookmark = rstRFP.LastModified
>        .Update
>    End With

>Thanks for your help!



Mon, 12 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Converting Access97 to Access2000 code

2. converting database from access97 to access2000

3. Converting from Access97 to Access2000

4. How to convert Access97 to Access2000?

5. Convert Access97 DB to Access2000 DB

6. Convert Access97 to Access2000

7. Converting Access2.0 database to Access2000 using VB

8. Convert Access95 to Access97 thru code

9. Convert Access95 to Access97 thru code

10. Problem connecting to Access2000 database...pls, pls help.

11. Problem opening Access2000 database

12. Compacting a Access97 Database with VB Code

 

 
Powered by phpBB® Forum Software