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

Runtime Error 3622 you must use dbSeeChanges

P: 2
Am Converting an Access 2000 database to SQL Express 2005. The Access database was divided into a backend (data) and front end (menus, queries, forms).
I am having problems with one of the forms, as the code which worked with Access is obviously wrong for sql.

specifically,
code as follows

Expand|Select|Wrap|Line Numbers
  1. If NewRecord=True Then
  2.  SectionName="Item Search code"
  3.  qry2="select top 1" &_
  4.           "DeceasedID, DateOfEntry from dbo_AllFields where "&_
  5.           "format(DateOfEntry, "yyyy-mm-dd"")='" & Format(DateOfEntry, "yyyy-mm-dd")&-
  6.           "'and DataEntryBy= '" & CurrentUser &_
  7.           "'and Dec_cn='" & Dec_cn &_
  8.           "'andFamilyna='" & Familyna & "'" & _
  9.           "order by DeceasedID desc"
  10.  
  11. Set rs = CurrentDb.openrecordset(qry2)
  12. mDeathID = rs!DeceasedID
  13. lblDeceasedID.Caption =mDeathID
  14. End If
I realise i need the dbseeChanges command on the set rs line, but i have tried numerous combinations with no success.

Please help.

thanks
Dec 5 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,660
Expand|Select|Wrap|Line Numbers
  1. If NewRecord Then
  2.  SectionName="Item Search code"
  3.  qry2="select top 1 " & _
  4.         "DeceasedID, DateOfEntry from dbo_AllFields where " & _
  5.         "format(DateOfEntry, 'yyyy-mm-dd')='" & Format(DateOfEntry, 'yyyy-mm-dd') & _
  6.         "' and DataEntryBy= '" & CurrentUser & _
  7.         "' and Dec_cn='" & Dec_cn & _
  8.         "' and Familyna='" & Familyna & _
  9.         "' order by DeceasedID desc"
  10.  
  11.  Set rs = CurrentDb.openrecordset(qry2)
  12.  mDeathID = rs!DeceasedID
  13.  lblDeceasedID.Caption =mDeathID
  14. End If
If you look through your code, or even look at qry2 before executing it, you'll see a fair number of typos where spaces are missing; (&) & (_) are used wrongly; etc.
I've updated the ones I noticed. With the code tags it's much easier to notice.
Dec 5 '06 #2

P: 2
Thank you i will make the changes and test again

Expand|Select|Wrap|Line Numbers
  1. If NewRecord Then
  2.  SectionName="Item Search code"
  3.  qry2="select top 1 " & _
  4.         "DeceasedID, DateOfEntry from dbo_AllFields where " & _
  5.         "format(DateOfEntry, 'yyyy-mm-dd')='" & Format(DateOfEntry, 'yyyy-mm-dd') & _
  6.         "' and DataEntryBy= '" & CurrentUser & _
  7.         "' and Dec_cn='" & Dec_cn & _
  8.         "' and Familyna='" & Familyna & _
  9.         "' order by DeceasedID desc"
  10.  
  11.  Set rs = CurrentDb.openrecordset(qry2)
  12.  mDeathID = rs!DeceasedID
  13.  lblDeceasedID.Caption =mDeathID
  14. End If
If you look through your code, or even look at qry2 before executing it, you'll see a fair number of typos where spaces are missing; (&) & (_) are used wrongly; etc.
I've updated the ones I noticed. With the code tags it's much easier to notice.
Dec 5 '06 #3

NeoPa
Expert Mod 15k+
P: 31,660
No problem.
I'm happy to look again if you need me to, but try using Debug.Print qry2 to see exactly what it's trying to execute first.
You may find you see the problems yourself which can save you some time.
Dec 5 '06 #4

Post your reply

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