Form to transfer object (1 Viewer)

JPR

Registered User.
Local time
Yesterday, 16:46
Joined
Jan 23, 2009
Messages
192
Hello. I have a database that I periodically requires some updates to either a form, a query, etc.
The db is used in different offices and to avoid other users to open the program in design view and cause problems, I was thinking of using the transfer object method. For this reason I have created a form with a cmb button that has the following code which I have found on the web and works fine:

Code example to transfer and replace existing object with same name:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Mydb.accdb", acQuery, "qrytestA", "qrytestA", False

Code example to transfer and replace existing object and change its name:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Mydb.accdb", acQuery, "qrytestA", "qrytestB", False

To make the transfer object method easier, I was thinking of adding to the form the following:

- A listbox to list the objects to transfer (my problem would be how to change the row source depending on the type of object, query, table, form)
- A textbox with the name (or new name) I want to give the the object to transfer
- A text box indicating the path of the db where to transfer the object
- Correct the above transferdatabase code

I appreciate any assistance you can give me with this.
Thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:46
Joined
May 7, 2009
Messages
19,230
that will require long hours of coding.
just compile your db and create an .accde.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:46
Joined
Sep 21, 2011
Messages
14,265
I would use some sort of FE updating tool? If you search for Bob Larsen under my userid you will see several threads where I mention I have used it.
I used that in my last place of work and when implemented it worked great. I would also keep a track of versions and bug fixes, and automated that into Bob's process.

Alternatively experts here recommend just copying the FE every time a user starts the FE DB?

Horses for courses.
 

JPR

Registered User.
Local time
Yesterday, 16:46
Joined
Jan 23, 2009
Messages
192
Thanks you both. I will give a look and take your advises.
 

JPR

Registered User.
Local time
Yesterday, 16:46
Joined
Jan 23, 2009
Messages
192
Hello. I have given a look at Bob Larsen's thread and found it very useful. Before I finally decide to abandon my idea I would like to share what I have come up with and know if its something still possible to do or if I am completely going in the wrong direction. I apologize for my confusion on this. I am attaching copy of the db.

Basically what I have done is created a form where it is possible to select the object(s) type that need to be transferred.
My doubt is if it was possible to replace the standard code which indicated the object type and names, with a value taken from controls.

Current Code:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Mydb.accdb", acQuery, "qrytestA", "qrytestB", False

How should it look like:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "txtPathPost", lstObject, "txtObjects", "txtObjects", False

Controls meaning
txtPathPost = The path where to transfer the object
lstObject = the type of object to copy
txtObjects = the name of the control to copy

Thank you
 

Attachments

  • test.accdb
    672 KB · Views: 226

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:46
Joined
Oct 29, 2018
Messages
21,467
Hello. I have given a look at Bob Larsen's thread and found it very useful. Before I finally decide to abandon my idea I would like to share what I have come up with and know if its something still possible to do or if I am completely going in the wrong direction. I apologize for my confusion on this. I am attaching copy of the db.

Basically what I have done is created a form where it is possible to select the object(s) type that need to be transferred.
My doubt is if it was possible to replace the standard code which indicated the object type and names, with a value taken from controls.

Current Code:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\Mydb.accdb", acQuery, "qrytestA", "qrytestB", False

How should it look like:

"DoCmd.TransferDatabase acExport, "Microsoft Access", "txtPathPost", lstObject, "txtObjects", "txtObjects", False

Controls meaning
txtPathPost = The path where to transfer the object
lstObject = the type of object to copy
txtObjects = the name of the control to copy

Thank you
Hi. Not in front of a computer right now, so I can't look at your file at the moment, so I could be wrong, but it should look somewhat like this.

Code:
DoCmd.TransferDatabase acExport, "Microsoft Access", Me.txtPathPost, Me.lstObject, Me.txtObjects, Me.txtObjects, False

Hope that helps...
 

JPR

Registered User.
Local time
Yesterday, 16:46
Joined
Jan 23, 2009
Messages
192
Hello, getting a run time error 13. Thank you
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:46
Joined
Oct 29, 2018
Messages
21,467
Hello, getting a run time error 13. Thank you
Error 13 is a type mismatch. You'll have to double check your argument values.
 

Users who are viewing this thread

Top Bottom