By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,136 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,136 IT Pros & Developers. It's quick & easy.

Converting to Access 2007

P: 9
Hi,

Am interested in migrating my app to Access 2007 to make use of the free availability of the Access 2007 runtime/developer tools, howver having some problems with the script below.


Expand|Select|Wrap|Line Numbers
  1. Dim db As Database
  2. Dim qdf As QueryDef
  3. Dim prm As Parameter
  4. Dim rs As Recordset
  5. Dim inte As Integer
  6.  
  7. Dim strCashier As String
  8. Dim strCatId As String
  9.  
  10. Set db = CurrentDb
  11. Set qdf = db.QueryDefs("CashierSelect1")
  12.  
  13.     For Each prm In qdf.Parameters
  14.             prm.Value = Eval(prm.name)
  15.     Next prm
  16.  
  17. Set rs = qdf.OpenRecordset(dbOpenDynaset)
Access2007 throws up a 'Mismatch' error at line 17 - works fine in Acc2000 and 2003, any ideas.

Thanks in advance.
Sep 13 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Not sure why its not working but to get around the problem try the following:

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim qdf As QueryDef
  3. Dim prm As Parameter
  4. Dim rs As Recordset
  5. Dim inte As Integer
  6. Dim strCashier As String
  7. Dim strCatId As String
  8.  
  9.     Set db = CurrentDb
  10.     Set qdf = db.QueryDefs("CashierSelect1")
  11.  
  12.     For Each prm In qdf.Parameters
  13.         prm.Value = Eval(prm.Name)
  14.     Next prm
  15.  
  16.     Set rs = db.OpenRecordset("CashierSelect1", dbOpenDynaset)
  17.  
  18.  
Sep 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.