Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / January 2006

Tip: Looking for answers? Try searching our database.

Treeview Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JamesJ - 25 Jan 2006 23:32 GMT
I'm trying to populate a treeview control with a field: MovieType
from tblDvdMovieType and am having no luck at all.
I'm using access 2003.

I'm using an example from Access 2000 Power Programming.
Currently this is how far I got. Wow! I'm getting a Type mismatch
error on the Set rst line and don't know why.

Private Sub Form_Load()

       Dim objCurrNode As Node
       Dim dbLocal As Database
       Dim rst As Recordset

       Set dbLocal = CurrentDb()
       Set rst = dbLocal.OpenRecordset("tblDvdMovieType")

End Sub

Any and all help will be appreciated.

James
Douglas J. Steele - 26 Jan 2006 01:43 GMT
Recordset is an object in both the ADO and DAO models. In Access 2003, the
reference to ADO is higher in the list of selected references than the
reference to DAO, therefore declaring something as a Recordset results in it
being an ADO recordset. However, you're using DAO, hence the error.

Change the line

Dim rst As Recordset

to

Dim rst As DAO.Recordset

(I have to suggest that your book may not be that good. Access 2000 didn't
include a reference to DAO by default: in order to be able to use that code,
you would have had to add a reference to DAO and remove the reference to
ADO. If the book doesn't explain that, I'd suggest getting a better book!)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> I'm trying to populate a treeview control with a field: MovieType
> from tblDvdMovieType and am having no luck at all.
[quoted text clipped - 18 lines]
>
> James
JamesJ - 26 Jan 2006 10:45 GMT
That worked fine.
Yes, I need to upgrade my book(s). Just haven't gotten
around to it.

Thanks,
James

> Recordset is an object in both the ADO and DAO models. In Access 2003, the
> reference to ADO is higher in the list of selected references than the
[quoted text clipped - 37 lines]
>>
>> James
Alex Dybenko - 26 Jan 2006 20:02 GMT
Hi James,
here one more sample, perhaps you find it useful
http://www.pointltd.com/Downloads/Details.asp?dlID=36

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> That worked fine.
> Yes, I need to upgrade my book(s). Just haven't gotten
[quoted text clipped - 45 lines]
>>>
>>> James
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.