473,406 Members | 2,369 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,406 software developers and data experts.

Access 2007 combo Box library woes


Hi Everybody

I am currently updating a 2000.mdb to a 2007.accdb and I am trying to
use the 3.6 DAO Object Library in the tools>references in the vb
editor. This produces an error "Name conflict with an Existing
Library" and yet I need this to run the following code.

I have a combo property set to "Limit to List" and on the "not in list
property" the following code needs to run

Any help gratefully received

Dim strMsg As String
#If USEDAO Then
Dim rst As DAO.Recordset
Dim db As DAO.Database
#Else
Dim rst As ADODB.Recordset
#End If

strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"
If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, _
"New Method") Then
Response = acDataErrDisplay
Else
#If USEDAO Then
Set db = CurrentDb()
Set rst = db.OpenRecordset("xtblCustomerPaidMethod")
#Else
Set rst = New ADODB.Recordset
rst.Open _
Source:="xtblCustomerPaidMethod", _
ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, _
LockType:=adLockOptimistic, _
Options:=adCmdTableDirect
#End If
rst.AddNew
rst("Data") = NewData
rst.Update
Response = acDataErrAdded
rst.Close
End If

Apr 2 '07 #1
5 3243
Access 2007 automatically uses DAO 3.6 when you open an MDB, and ACE when
you open an ACCDB. However, both libraries are known as DAO within VBA code.
Therefore your code will work without the need to force it.

You can verify that by opening an ACCDB. Open the Immediate Window (Ctrl+G),
and enter:
? References("DAO").FullPath

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"bobdydd" <re**************@yahoo.co.ukwrote in message
news:11*********************@p15g2000hsd.googlegro ups.com...
>
Hi Everybody

I am currently updating a 2000.mdb to a 2007.accdb and I am trying to
use the 3.6 DAO Object Library in the tools>references in the vb
editor. This produces an error "Name conflict with an Existing
Library" and yet I need this to run the following code.

I have a combo property set to "Limit to List" and on the "not in list
property" the following code needs to run

Any help gratefully received

Dim strMsg As String
#If USEDAO Then
Dim rst As DAO.Recordset
Dim db As DAO.Database
#Else
Dim rst As ADODB.Recordset
#End If

strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"
If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, _
"New Method") Then
Response = acDataErrDisplay
Else
#If USEDAO Then
Set db = CurrentDb()
Set rst = db.OpenRecordset("xtblCustomerPaidMethod")
#Else
Set rst = New ADODB.Recordset
rst.Open _
Source:="xtblCustomerPaidMethod", _
ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, _
LockType:=adLockOptimistic, _
Options:=adCmdTableDirect
#End If
rst.AddNew
rst("Data") = NewData
rst.Update
Response = acDataErrAdded
rst.Close
End If
Apr 2 '07 #2
In Access 2007, DAO comes from acedao.dll, not dao360.dll.

In other words, you shouldn't need to add a DAO reference: Microsoft came to
their senses in Access 2003, and DAO is back by default.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"bobdydd" <re**************@yahoo.co.ukwrote in message
news:11*********************@p15g2000hsd.googlegro ups.com...
>
Hi Everybody

I am currently updating a 2000.mdb to a 2007.accdb and I am trying to
use the 3.6 DAO Object Library in the tools>references in the vb
editor. This produces an error "Name conflict with an Existing
Library" and yet I need this to run the following code.

I have a combo property set to "Limit to List" and on the "not in list
property" the following code needs to run

Any help gratefully received

Dim strMsg As String
#If USEDAO Then
Dim rst As DAO.Recordset
Dim db As DAO.Database
#Else
Dim rst As ADODB.Recordset
#End If

strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"
If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, _
"New Method") Then
Response = acDataErrDisplay
Else
#If USEDAO Then
Set db = CurrentDb()
Set rst = db.OpenRecordset("xtblCustomerPaidMethod")
#Else
Set rst = New ADODB.Recordset
rst.Open _
Source:="xtblCustomerPaidMethod", _
ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, _
LockType:=adLockOptimistic, _
Options:=adCmdTableDirect
#End If
rst.AddNew
rst("Data") = NewData
rst.Update
Response = acDataErrAdded
rst.Close
End If

Apr 2 '07 #3
On 2 Apr, 17:46, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.comwrote:
In Access 2007, DAO comes from acedao.dll, not dao360.dll.

In other words, you shouldn't need to add a DAO reference: Microsoft came to
their senses in Access 2003, and DAO is back by default.
Hi All

The addition of "Microsoft Activex Data Objects 2.8 Library" did the
trick

Thanks guys

Apr 2 '07 #4
"bobdydd" <re**************@yahoo.co.ukwrote in
news:11**********************@n76g2000hsh.googlegr oups.com:
The addition of "Microsoft Activex Data Objects 2.8 Library" did
the trick
Then you weren't using DAO in the first place -- that's the ADO
library.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 3 '07 #5
Doh!!

I am gonna drop the decaff ................it's making me sluggish

I was pretty proud of myself getting to grips with 2007 and then fell
down

Thanks for picking me up

Bob
The addition of "Microsoft Activex Data Objects 2.8 Library" did
the trick

Then you weren't using DAO in the first place -- that's the ADO
library.
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Apr 3 '07 #6

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

Similar topics

27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
2
by: Joseph Macari | last post by:
I recently installed Access 2007; I've been a long time user of access (from ver 1 ). The following code snippet is giving me fits- << Select Case myTide Case 1 Select Case myTideStage Case...
1
by: Chris | last post by:
Is there any advantage for using "Microsoft Office 12.0 Access Database Engine Object Library" instead of DAO360.DLL for Access 2007 ?
1
by: Eugene | last post by:
Hello All, I need a report in Access 2007 to show a dynamic image on every page. I have a table, and I store image's path in a cell in each of the rows. In 2003, I was able to do that using...
9
by: anthony | last post by:
In Access 2007, why does a query field designed as Term: ! ! return 00:00:00 when cboTerm actually contains 08SP. This works as expected in Access 2003?
2
kmartinenko
by: kmartinenko | last post by:
Hi everyone, I have several combo boxes on my form, and while I have designated a column head, I cannot figure out how to default to the column head value. What I really want is for all of my...
0
by: Bernadette Vandaele | last post by:
Hi, I am changing the background color of a combo box in a continuous form in Access 2007 with vba (... .backcolor = ...) from grey to white, but it doesn't work for all the lines in the...
8
by: jerken | last post by:
Im working in Access 2007 using two Combo boxes to select a category then product type. I am trying to get a couple fields to be displayed based on what the values are in the combo boxes. I have the...
0
by: Elaine Huseby | last post by:
I have a form "PartsAndInvoices that has all the parts in the database listed in split form view. I want the user to use Access 2007's filter section on the ribbon to choose mutiple filters....
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.