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 / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

What is wrong with this code ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mscertified - 11 Mar 2005 17:49 GMT
I get an error message on the .Add LINE ("only user-defined types defined in
public object modules can be coerced to or from a variant or passed to
late-bound functions")

   Dim myPriority As typPriority   'In module CustomTypes
   Dim colPriority As New Collection
   .........
   Do While Not rs.EOF
      myPriority.Code = rs.Fields("Code").Value
      myPriority.Desc = rs.Fields("Desc").Value
      colPriority.Add myPriority <==== Error here
   Loop
George Nicholson - 11 Mar 2005 19:48 GMT
"object module" = class module

AFAIK, if typPriority were a Class (or if it was "from" a Class?), you could
add instances of it to a collection. But if it isn't a built-in type, or
created from a Class module, no.

HTH,
Signature

George Nicholson

Remove 'Junk' from return address.

>I get an error message on the .Add LINE ("only user-defined types defined
>in
[quoted text clipped - 9 lines]
>       colPriority.Add myPriority <==== Error here
>    Loop
 
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.