How do I repair Error 91 in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a novice (But learning quickly) with Access - I keep getting an "on"
again, "off" again "Error 91" (Object Variable wo with Object Variable not
set) - how can I fix this permanaently? It "appears' , then disappears but I
can not honestly say I fixed it - How can I at least claear it out so I can
proceed?

Thanks!!

Larry
 
Hi Larry,

You didn't state under what circumstances you are receiving this error. Are
you working with VBA code? This error can commonly occur if one does not set
a variable, before attempting to use it. For example:

Sub Test
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set rs = db.OpenRecordset("Customers")
etc.

End Sub

This subroutine would bomb out with error 91 on the third line of code,
since we have not used a set statement to set the database variable, such as:

Set db = CurrentDB()

immediately prior to the set rs line.


If my answer has helped you, please answer yes to the question that reads
"Did this post answer the question?" at the bottom of the message thread.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I am a novice (But learning quickly) with Access - I keep getting an "on"
again, "off" again "Error 91" (Object Variable wo with Object Variable not
set) - how can I fix this permanaently? It "appears' , then disappears but I
can not honestly say I fixed it - How can I at least claear it out so I can
proceed?

Thanks!!

Larry
 
Tom - Thanks so much - It is a data base that tracks contracts activity - one
of the very first steps is to enter a contract reference or go to the menu
and select a contract - that is where my message 91 occurs, but not all the
time - sometimes it does, other times it does not occur, and as stated, I do
not believe anything I do really clears it up - it is more random.

Let me add this - there are 4 other users of this data base - 2 are on
Access 2000 and the others are on Access 2002 - the Access 2002 users have
the "91" problem - I can go to the Access 2000 stations, Log In in my name
and proceed with no difficulty - again, we are novices trying fundamental
things to define the problem - could there be something in Access 2002
triggering the Error 91?

Thanks

Larry
 
Hi Larry,

Is your database split into a two .mdb files: front-end (FE) and back-end
(BE) .mdb files? If so, does each user have a copy of the FE file installed
on their local hard drive. The FE .mdb file--actually better to use the
compiled .mde form--should contain all queries, forms, reports, macros,
modules and any local tables that are not shared. An example would be a table
that stores user preferences, or a relatively stable table, such as a list of
states, where the data does not change regularly. The BE .mdb file, which
contains *only* the tables with shared data should be copied to the file
server. This is the only file that should be shared.

I suspect that you are sharing the entire database (unsplit), and that you
are hitting this database using different versions of Access. Sharing an
entire database over a network has previously been identified by personnel on
the Microsoft Access development team as the #1 cause of JET database
corruption. It is very possible that you have references that are considered
MISSING as soon as more than one version of Access attempts to open an shared
file. Access can correct some version dependent references on-the-fly, but
not when multiple versions of Access are hitting the same shared .mdb file.
Here are a few links to read more on the topic of splitting a database:

http://www.access.qbuilt.com/html/gem_tips.html#SplitDB

http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm

http://allenbrowne.com/ser-01.html

If my answer has helped you, please answer yes to the question that reads
"Did this post answer the question?" at the bottom of the message thread.

Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Tom - Thanks so much - It is a data base that tracks contracts activity - one
of the very first steps is to enter a contract reference or go to the menu
and select a contract - that is where my message 91 occurs, but not all the
time - sometimes it does, other times it does not occur, and as stated, I do
not believe anything I do really clears it up - it is more random.

Let me add this - there are 4 other users of this data base - 2 are on
Access 2000 and the others are on Access 2002 - the Access 2002 users have
the "91" problem - I can go to the Access 2000 stations, Log In in my name
and proceed with no difficulty - again, we are novices trying fundamental
things to define the problem - could there be something in Access 2002
triggering the Error 91?

Thanks

Larry
__________________________________________

:

Hi Larry,

You didn't state under what circumstances you are receiving this error. Are
you working with VBA code? This error can commonly occur if one does not set
a variable, before attempting to use it. For example:

Sub Test
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set rs = db.OpenRecordset("Customers")
etc.

End Sub

This subroutine would bomb out with error 91 on the third line of code,
since we have not used a set statement to set the database variable, such as:

Set db = CurrentDB()

immediately prior to the set rs line.


If my answer has helped you, please answer yes to the question that reads
"Did this post answer the question?" at the bottom of the message thread.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I am a novice (But learning quickly) with Access - I keep getting an "on"
again, "off" again "Error 91" (Object Variable wo with Object Variable not
set) - how can I fix this permanaently? It "appears' , then disappears but I
can not honestly say I fixed it - How can I at least claear it out so I can
proceed?

Thanks!!

Larry
 
Back
Top