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 / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

Help On Transfer of forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AL FINK - 14 Sep 2005 15:46 GMT
I have the foolowing code that seems to be causing trouble
SQLstring = "SELECT MSysObjects.Name FROM MsysObjects WHERE
(Left$([Name],1)<>'~') AND " & _
'"(MSysObjects.Type)=-32768 ORDER BY MSysObjects.Name;"

Set rs = New ADODB.Recordset
rs.Open SQLstring, MyConn, _
   adOpenDynamic, adLockOptimistic

With rs
   Do While Not .EOF
      Objname = !Name
                .Update
                .MoveNext
   DoCmd.TransferDatabase acExport, "Microsoft Access", Mydestination,
acForms, Objname, Objname
   Loop
End With

MyConn.Close
Set MyConn = Nothing

As you can see I get a list of forms from the system and then try to
tranfser the items to another database. What happens is I get a error
stating the item can not be found, does anyone have a idea why?
Dirk Goldgar - 14 Sep 2005 16:08 GMT
> I have the foolowing code that seems to be causing trouble
> SQLstring = "SELECT MSysObjects.Name FROM MsysObjects WHERE
[quoted text clipped - 21 lines]
> tranfser the items to another database. What happens is I get a error
> stating the item can not be found, does anyone have a idea why?

The most obvious reason for the error you report is that there is no
constant "acForms".  You should have written "acForm".

Since I don't know how MyConn is opened, I don't know if it's pointing
to the current database, or even if you should be closing it.

Why do you call the recordset's .Update method even though you've made
no changes to the record?  Also, you ought to close the recordset with
"rs.Close".

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

AL FINK - 14 Sep 2005 16:21 GMT
I found it all I had to do was change the acforms to acform and that fixed
it

>I have the foolowing code that seems to be causing trouble
> SQLstring = "SELECT MSysObjects.Name FROM MsysObjects WHERE
[quoted text clipped - 21 lines]
> tranfser the items to another database. What happens is I get a error
> stating the item can not be found, does anyone have a idea why?
 
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.