473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

User-defined type not defined

Hi everyone,

I have an error message in an Access 97 database & I was hoping
someone may be able to help me get rid of it (bearing in mind I only
have an average understanding of Access & absolutely none of VB
coding). Originally, this database was in Access 2003 format. I opened
it in 2003, then used the convert option to back it down to Access 97.
I then opened it in 97. Upon opening, I get this error message:
"compile error: user-defined type not defined". When I click ok, I am
taken to a screen with a window title of "form_switchboard", with some
code in it. "Private Sub FillOptions()" is highlighted in yellow, with
an arrow beside it. Just below this is a line "Dim dbs As Database",
with the "dbs As Database" part highlighted in blue. I can then click
on the "end" button on the Access toolbar, & I will be taken back to
the screen which shows the box with the
tables/queries/forms/reports/macros/modules tabs. I have discovered
that removing the switchboard gets rid of the error. Even creating a
new switchboard after removing the original one causes the error
message. All the switchboard consists of is two buttons, one opening a
form in add mode, the other opening it in edit mode. Yet, after
removing the switchboard, I can still open the relevant form without
error, so I'm assuming that somehow, something in the switchboard code
is the problem. So, can anyone tell me what the problem is, & how I
might be able to fix it?

Thanks,

CM
Nov 13 '05 #1
5 6532
eh***********@yahoo.com (Chris) wrote:
Upon opening, I get this error message:
"compile error: user-defined type not defined". When I click ok, I am
taken to a screen with a window title of "form_switchboard", with some
code in it. "Private Sub FillOptions()" is highlighted in yellow, with
an arrow beside it. Just below this is a line "Dim dbs As Database",
with the "dbs As Database" part highlighted in blue.


This switchboard was created using the switchboard add-in. I've never tried
back-pedalling through Access versions but I imagine that an app created in
v2kx will contain lots of code that A97 can't handle. Just a thought
though, try changing "Dim dbs As Database" to "Dim dbs As DAO.Database".

Regards,
Keith.
Nov 13 '05 #2
Database comes from the DAO library. With any module open, select Tools |
References from the menu bar.
You need to ensure that the Microsoft DAO 3.5x Object Library reference is
checked.

While you're there, though, you might as well check whether there are any
other References problems (they're very common when switching versions of
software)

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Chris" <eh***********@yahoo.com> wrote in message
news:bc**************************@posting.google.c om...
Hi everyone,

I have an error message in an Access 97 database & I was hoping
someone may be able to help me get rid of it (bearing in mind I only
have an average understanding of Access & absolutely none of VB
coding). Originally, this database was in Access 2003 format. I opened
it in 2003, then used the convert option to back it down to Access 97.
I then opened it in 97. Upon opening, I get this error message:
"compile error: user-defined type not defined". When I click ok, I am
taken to a screen with a window title of "form_switchboard", with some
code in it. "Private Sub FillOptions()" is highlighted in yellow, with
an arrow beside it. Just below this is a line "Dim dbs As Database",
with the "dbs As Database" part highlighted in blue. I can then click
on the "end" button on the Access toolbar, & I will be taken back to
the screen which shows the box with the
tables/queries/forms/reports/macros/modules tabs. I have discovered
that removing the switchboard gets rid of the error. Even creating a
new switchboard after removing the original one causes the error
message. All the switchboard consists of is two buttons, one opening a
form in add mode, the other opening it in edit mode. Yet, after
removing the switchboard, I can still open the relevant form without
error, so I'm assuming that somehow, something in the switchboard code
is the problem. So, can anyone tell me what the problem is, & how I
might be able to fix it?

Thanks,

CM

Nov 13 '05 #3
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message news:<%M******************@news04.bloor.is.net.cab le.rogers.com>...
Database comes from the DAO library. With any module open, select Tools |
References from the menu bar.
You need to ensure that the Microsoft DAO 3.5x Object Library reference is
checked.


Hi everyone,

Thanks for the replies. I gave both Keith's & Doug's suggestions a go.
Changing the "Dim dbs As Database" to "Dim dbs As DAO.Database" as per
Keith's suggestion didn't work - I just got the same message. I then
tried going into Reference's as Doug suggested. I ticked the Microsoft
DAO 3.51 entry, & then closed & opened the database again. Well, the
original "user-defined" error has now gone, but there is a new error.
Upon opening the database, I get a "run time error 13: type mismatch"
error message. When I click debug, I get the same "form_switchboard"
screen as in the original error. This time however, the phrase "Set
rst = dbs.OpenRecordset(strSQL)" is highlighted in yellow (with an
arrow beside it). This is under the same heading as the original error
message (ie "Private Sub FillOptions()"). It seems progress has been
made, but can anyone help me decode this error?

CM
Nov 13 '05 #4
> Thanks for the replies. I gave both Keith's & Doug's suggestions a go.
Changing the "Dim dbs As Database" to "Dim dbs As DAO.Database" as per
Keith's suggestion didn't work - I just got the same message. I then
tried going into Reference's as Doug suggested. I ticked the Microsoft
DAO 3.51 entry, & then closed & opened the database again. Well, the
original "user-defined" error has now gone, but there is a new error.
Upon opening the database, I get a "run time error 13: type mismatch"
error message. When I click debug, I get the same "form_switchboard"
screen as in the original error. This time however, the phrase "Set
rst = dbs.OpenRecordset(strSQL)" is highlighted in yellow (with an
arrow beside it). This is under the same heading as the original error
message (ie "Private Sub FillOptions()"). It seems progress has been
made, but can anyone help me decode this error?


Both the ADO and DAO Object models support a Recordset object. I'm
guessing that you have a reference to ADO (Microsoft ActiveX Data
Object 2.x) that appears higher than your DAO reference in your
reference list so without specifying which to use the compiler uses
the first one in the list (ADODB) causing the "type mismatch" error.

You can either remove the ADO reference, move it lower in the list
than the DAO reference or (best solution) declare that you want a DAO
recordset in your code by declaring it as so:

Dim rst As DAO.Recordset

The reason that the DAO. prefix had no effect when declaring the
Database object is that only DAO has a Database object so there was no
ambiguity.

'---------------
' John Mishefske
'---------------
Nov 13 '05 #5
mi****@execpc.com (almish) wrote in message news:<95**************************@posting.google. com>...
Both the ADO and DAO Object models support a Recordset object. I'm
guessing that you have a reference to ADO (Microsoft ActiveX Data
Object 2.x) that appears higher than your DAO reference in your
reference list so without specifying which to use the compiler uses
the first one in the list (ADODB) causing the "type mismatch" error.

You can either remove the ADO reference, move it lower in the list
than the DAO reference or (best solution) declare that you want a DAO
recordset in your code by declaring it as so:

Dim rst As DAO.Recordset

The reason that the DAO. prefix had no effect when declaring the
Database object is that only DAO has a Database object so there was no
ambiguity.


Awesome! Thanks John, that did the trick. I wasn't sure where to put
the code that you said would be the best solution, so I simply moved
that ActiveX Data Object one space lower than the DAO Object. I am now
able to open the database without errors, switchboard enabled & all!
:-) I'm not a big database designing person (I have only made 2), so
I'm not sure what (if any) effect this change will have on Access, so
hopefully what I did won't cause any errors in the other database I
made. I have opened it to have a quick check, & all seems ok, so I
will keep my fingers crossed.

Regards,

CM
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
3
by: Jiho Han | last post by:
Should ASPNET user belong to the local Users group? I may have made some changes that affected my workstation setup and I am experiencing some unexpected behaviors. For example, I have my IIS...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: Carlettus | last post by:
Dear All, sorry but I'm not sure if this is the right place to post my problem. I was using the following asp code to create users in Active Directory. Suddenly, and I don't know the reason, users...
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.