PC Review


Reply
Thread Tools Rate Thread

Access 2007 combo Box library woes

 
 
bobdydd
Guest
Posts: n/a
 
      2nd Apr 2007

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

 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      2nd Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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
>


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      2nd Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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
>



 
Reply With Quote
 
bobdydd
Guest
Posts: n/a
 
      2nd Apr 2007
On 2 Apr, 17:46, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> 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

 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      3rd Apr 2007
"bobdydd" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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/
 
Reply With Quote
 
bobdydd
Guest
Posts: n/a
 
      3rd Apr 2007
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/



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 - Combo Boxes to break down list in othe combo box A_Barnes General Software 1 23rd Jul 2011 03:05 PM
Access 2007, refer to a combo in another combo on the subform Laursen.Aarup Microsoft Access Forms 3 2nd Apr 2009 12:18 PM
MS Outlook 12 Library error from Access 2007 ARC Microsoft Outlook Installation 1 18th Aug 2007 08:07 PM
static library woes sklett Microsoft VC .NET 3 9th Dec 2005 04:52 AM
C runtime library woes in Managed C++ Gerhard Menzl Microsoft VC .NET 5 19th Aug 2004 12:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:47 PM.