Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting Intermitant Error in VBA after Upsizing (error 3622)

14 views
Skip to first unread message

Max Right

unread,
Mar 23, 2010, 2:15:43 PM3/23/10
to
The error I'm getting is: runtime 3622
"You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server tables that has an IDENTITY column."

this is the part of my code causing the error....
...
Dim tGC
Set tGC = CurrentDb.OpenRecordset("tblGCdata") <----
....

This error is intermitant and seems to go away when I open the linked
table in access then close it and try running the code again.

what is the reason behind this and what I can do to eliminate this
error?
...perhaps some initial vba code to open and close the table?


Sylvain Lafontaine

unread,
Mar 23, 2010, 4:16:56 PM3/23/10
to
What you have to do is to add this option to the function call. However,
this is the third parameter and in VBA, intermediary parameters cannot be
set by default; so you will also have to specify the second parameter as
well; for example:

Set tGC = CurrentDb.OpenRecordset("tblGCdata", dbOpenDynaset, dbSeeChanges)

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)


"Max Right" <risky...@gmail.com> wrote in message
news:1a6a9963-c543-4fe9...@n39g2000prj.googlegroups.com...

Max Right

unread,
Mar 23, 2010, 5:36:25 PM3/23/10
to
> Set tGC = CurrentDb.OpenRecordset("tblGCdata", dbOpenDynaset, dbSeeChanges)

I tried adding these options and as soon as I include that I get a
complie error saying variable "dbOpenDynaset" not defined, if I delete
it it say the same thing for "dbSeeChanges"

i am not declaring tCG properly, I'm not too sure about vba syntax so
my declaration for tGC is:

Dim tGC

.. could it be something else?

Sylvain Lafontaine

unread,
Mar 23, 2010, 5:49:26 PM3/23/10
to
If they are not defined, it's because you have a missing reference (DAO?) in
the list of references for the VBA Editor. You could use their numerical
values instead but a better option would be to correct your references.

dbOpenDynaset: 2
dbSeeChanges: 512

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)


"Max Right" <risky...@gmail.com> wrote in message

news:a11df9ba-8eeb-4b73...@g1g2000pre.googlegroups.com...

Max Right

unread,
Mar 23, 2010, 8:41:32 PM3/23/10
to
Sylvain, I want to thank you for your help my freind, like you said,
the references where not there and as soon as I added them everything
worked!
0 new messages