[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

RE: Send Form to Remote Database

Ron Coderre

12/13/2006 6:02:00 PM

Did you intend to post to the MS ACCESS group?
(This is the EXCEL group)

***********
Regards,
Ron

XL2002, WinXP


"Cydney" wrote:

> I am trying to send a table, query, form, and module to several remote
> databases. I can do that easily using the code below. Now when a change is
> made to the original objects, I want to send them out again, replacing what
> is in the databases. However, it seems only to work for tables, queries, and
> modules. When I try to send out the form over an existing one, it won't let
> me.
>
> How can I resolve this?
>
> [see code below]
>
> Function SendStuffToRemoteDB()
> Dim MyPath As String
> Dim MyQryFile As String, MyModule As String, MyTable As String
> Dim dbs As DAO.Database
> Dim dbsRemote As DAO.Database
> Dim rst As DAO.Recordset
>
> DoCmd.SetWarnings False
>
> Set dbs = CurrentDb
> Set rst = dbs.OpenRecordset("ListOfInvoiceDBs")
>
> MyTable = "PrintList"
> MyQryFile = "qPrintList"
> MyForm = "frmPrintList"
> MyModule = "PrintToPDFProcess"
>
> On Error Resume Next
>
> Do While Not rst.EOF
> MyPath = rst.Fields("Path").Value
> MyFile = rst.Fields("DB").Value
> MyPathFile = MyPath & MyFile
>
> DoCmd.CopyObject MyPathFile, MyQryFile, acQuery, MyQryFile
> DoCmd.CopyObject MyPathFile, MyTable, acTable, MyTable
> DoCmd.CopyObject MyPathFile, , acForm, MyForm
> DoCmd.TransferDatabase acExport, "Microsoft Access", _
> MyPathFile, acModule, MyModule, MyModule
> rst.MoveNext
> Loop
>
> DoCmd.SetWarnings True
> End Function
>
> --
> THX cs
1 Answer

Cydney

12/13/2006 6:10:00 PM

0

Sorry... wrong group. I'll re-post correctly. Please delete this.
--
THX cs


"Ron Coderre" wrote:

> Did you intend to post to the MS ACCESS group?
> (This is the EXCEL group)
>
> ***********
> Regards,
> Ron
>
> XL2002, WinXP
>
>
> "Cydney" wrote:
>
> > I am trying to send a table, query, form, and module to several remote
> > databases. I can do that easily using the code below. Now when a change is
> > made to the original objects, I want to send them out again, replacing what
> > is in the databases. However, it seems only to work for tables, queries, and
> > modules. When I try to send out the form over an existing one, it won't let
> > me.
> >
> > How can I resolve this?
> >
> > [see code below]
> >
> > Function SendStuffToRemoteDB()
> > Dim MyPath As String
> > Dim MyQryFile As String, MyModule As String, MyTable As String
> > Dim dbs As DAO.Database
> > Dim dbsRemote As DAO.Database
> > Dim rst As DAO.Recordset
> >
> > DoCmd.SetWarnings False
> >
> > Set dbs = CurrentDb
> > Set rst = dbs.OpenRecordset("ListOfInvoiceDBs")
> >
> > MyTable = "PrintList"
> > MyQryFile = "qPrintList"
> > MyForm = "frmPrintList"
> > MyModule = "PrintToPDFProcess"
> >
> > On Error Resume Next
> >
> > Do While Not rst.EOF
> > MyPath = rst.Fields("Path").Value
> > MyFile = rst.Fields("DB").Value
> > MyPathFile = MyPath & MyFile
> >
> > DoCmd.CopyObject MyPathFile, MyQryFile, acQuery, MyQryFile
> > DoCmd.CopyObject MyPathFile, MyTable, acTable, MyTable
> > DoCmd.CopyObject MyPathFile, , acForm, MyForm
> > DoCmd.TransferDatabase acExport, "Microsoft Access", _
> > MyPathFile, acModule, MyModule, MyModule
> > rst.MoveNext
> > Loop
> >
> > DoCmd.SetWarnings True
> > End Function
> >
> > --
> > THX cs