Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Version Conflict??

Status
Not open for further replies.

shannonp

IS-IT--Management
Nov 13, 2001
289
NZ
I've created a database which runs well under Access 2000. Now when running the same database under Access XP it crashes when I go to perform a particular action; "It crashes when I go to click a button on a form", heres the code for that button:

Code:
Private Sub Transfer_Click()
On Error Resume Next
    Dim dbs As Database
    Dim rstPlayers As Recordset

    Set dbs = CurrentDb
    Set rstPlayers = dbs.OpenRecordset("Players", dbOpenDynaset)
    
    With rstPlayers
            .AddNew
            ![Tournament ID] = Forms![Main Menu]![Tournament ID]
            !Gender = PlayerSex
            !Name = PlayerName
            !Code = PlayerCode
            !Points = PlayerPoints
            ![Age Group] = AgeGroup
            !Grade = PlayerGradeM & PlayerGradeF
            .Update
            .Bookmark = .LastModified
    End With
    
    rstPlayers.Close
    dbs.Close
    
    Forms![Add Tournament Players]![Tournament Players].Form.Requery
    Forms![Add Tournament Players]![Tournament Players].SetFocus
    
    DoCmd.GoToRecord , , acLast
End Sub

Any reason why this works in Access 2000 and not Access XP (or 03)? as I cannot see anything in the above code that would do this??

[yinyang]
Shann
 
Add a watchpoint (click to the far left of the Module window or use the menu) at the first "Set" statement and then press the button. Then use F8 to step through. That should pinpoint the problem statement.

You should clarify in your 2 Dim statements whether you are using DAO or ADO objects:

Dim dbs as DAO.Database
Or
Dim dbs as ADO.Database

John
 
I agree with JonFer. I expect you want to use:
Dim dbs as DAO.Database
Dim rstPlayers As DAO.Recordset
Make sure you have a reference set to the Microsoft DAO library.


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top