Results 1 to 2 of 2
  1. #1
    daversb is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    6

    code changes from access 2003 to access 2007

    I am migrating a 2003 database to a 2007 database. I need some assistance....I have vba poping up when i select a function and pops up refrencing the same syntax.

    Private Sub cmd_Post_Click()
    Dim D As Database, I As Integer, R As Recordset, Y, RowSeperator
    Dim SQLText As String
    Dim CCounty As String
    SQLText = "SELECT qry_TaxRate.CityName, qry_TaxRate.CountyName"
    SQLText = SQLText & " FROM qry_TaxRate"
    SQLText = SQLText & " WHERE ((([qry_TaxRate].CityName)='" & Me!ShipCity & "'));"


    This is an example. the above in highlighted is the problem child....



    Not sure if there was vba language changes that arent recognized by 2007 from 2003

  2. #2
    SteveF is offline Generally AccessAble
    Windows XP Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Location
    Fourth Corner
    Posts
    123
    Do you want to use ADODB or DAO for your connections?

    You'd probably be best off if you explicitly declare your connection type, like this:

    Dim D as DAO.Database, R as DAO.Recordset

    Different versions of Access have in the past used either ADODB or DAO as the "default" -- unless you specify, you'll get the default connection, which may not be what you coded for.

    I learned the hard way years ago: Access 97 is DAO-only, Access 2000 introduced and defaults to ADODB. All of a sudden, my A97 apps weren't working! Ever since, I specify which to use & my apps run across versions without a problem in this area.

    Give that a try & let us know if it works.

    Steve

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Can we run Access 2003 db from Access 2007?
    By mafrank101 in forum Access
    Replies: 2
    Last Post: 04-23-2010, 09:26 AM
  2. Replies: 6
    Last Post: 12-01-2009, 11:59 AM
  3. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM
  4. converting from Access 2003 to Access 2007
    By LawrenceLau in forum Access
    Replies: 6
    Last Post: 11-20-2008, 03:53 PM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums