Tip Drag & drop objects from one database to another (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
Video just uploaded to YouTube:
 

strive4peace

AWF VIP
Local time
Today, 12:31
Joined
Apr 3, 2020
Messages
1,002
and indeed you did, @isladogs! Here is the video,

Drag & Drop Access Database Objects (7:00)

funny comment, @NauticalGent -- because I'm inside and get it ;)

I've marked it to watch later, when I log into YouTube so I can Like it (assume it'll be worthy). I knew about this trick but you're right, not many do -- and it's good to know!

Colin, I see while I was writing this message, you beat me to posting a link ... we must have been writing at the same time -- my message took longer to write than yours though, and I also had to update my database (smile)
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
Hi Crystal
Ha! At first I thought you'd dragged the video from my post and dropped it on yours! :)

For anyone interested, exactly the same feature is available in Excel - drag a worksheet from one open Excel workbook to another.
Partly true in PowerPoint as well - you can drag the contents of one or more slides ...BUT you lose the background design
Not sure whether there is any equivalent feature in Word
 

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
Thanks for the link.

I'm really not sure how you could create a shortcut to a function or create a file just containing a function.

Similarly of all the 10 shortcut file types listed, the only one I don't understand is .MAG - what type of diagram is that? Is it possible to link to a diagram from SSMS?
 

strive4peace

AWF VIP
Local time
Today, 12:31
Joined
Apr 3, 2020
Messages
1,002
remember, you're dragging to the desktop to MAKE a shortcut ... apparently, from this, it seems Access can handle some other data formats not on the menu ... that's pretty interesting if its true!

@isladogs , re: "BUT you lose the background design" -- you can click on the little floatie to keep the source formatting when you drop it -- it only defaults to using the destination's master

What I drag the most is files to open into an application window. I have a dual installation, so I can't double-click to open with the latest version of Word, Excel, or PowerPoint. With Access, though, I can right-click on a file in Windows Explorer and pick which version I want to open it with -- that's nice!

With other applications like Camtasia (where I usually want the older version but it defaults to latest -- again, I got multiple ones installed), I usually drag the video project I'm editing into the open version I want to use.

The files never have the same name, which is why I don't just go get the last one ... zip them and rename them before opening again
 

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
If I knew what a 'diagram' meant, I could probably create a .MAG shortcut!
Perhaps its another outdated relic like .MAW (Data Access Page shortcut)

I've asked Shane if he can explain both .MAG shortcuts & .MAU files

I've had dual Office 2010 & 365 installations for years. Before that I had 2003 & 2010.
When I want to select which version a particular file is opened in, I just right click the file, click Open With... then choose the version
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
Access team member has confirmed that both .MAG and .MAU refer to features deprecated many years ago in Access.

Since publicising this feature, I've read comments such as it doesn't work if the object is open or if the database isn't fully compiled.
I cannot replicate either issue despite repeated testing.

However, over at AF.net, @Ajax made the valid point that table relationships cannot be transferred by this method. I will also add that neither can references.

One thing I did forget to mention is that modules can also be dragged from the VBE of one database to another
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:31
Joined
Feb 19, 2002
Messages
43,361
Since I use it so much, I run into this occasionally. It has to do with editing. Access doesn't necessarily save the FE objects you change immediately the way it does with data so it may be that one db or the other is in a "state". I never examined it closely to see exactly what causes the error message. Closing and reopening resolves the problem.
 
Last edited:

strive4peace

AWF VIP
Local time
Today, 12:31
Joined
Apr 3, 2020
Messages
1,002
I can imagine that desktop shortcuts to launch a macro to RunCode might be helpful in some cases
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:31
Joined
Feb 19, 2002
Messages
43,361
Isn't FAQ useful for that? I keep moving regular questions out of FAQ to more appropriate forums.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 18:31
Joined
Jul 9, 2003
Messages
16,287
FAQ Here...

I just had a look in the FAQ section and can see what @Pat Hartman alluded to, there's stuff in there that shouldn't be in there! That's the essence of the problem with having a hints and tips forum, something else to maintain. We could run the site like Colditz, if anyone commits an offence just ban them, but I note other sites where they are very strict aren't the most successful or popular...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:31
Joined
Feb 19, 2002
Messages
43,361
OK, then YOU take the crap out of FAQ's:) I just sent one of the worst offenders a message since he just posted three new questions there.
 

Sun_Force

Active member
Local time
Tomorrow, 02:31
Joined
Aug 29, 2020
Messages
396
......, I've read comments such as it doesn't work if the object is open or if the database isn't fully compiled.
I cannot replicate either issue despite repeated testing.
@isladogs
to replicate follow these steps.

  1. Create a new database
  2. Add a new form, open it in design view, add several controls (button, textbox). DON'T save the form. Don't compile the database.
  3. open an existing database, go to vba, open a module, add a procedure that has an error. something like:
    Sub Test()
    h
    end sub
  4. Again Don't save the module. Don't compile the database.
  5. Now from the database you've opened in step 3, drag a form to the new database from step 1
you will receive this:

2021-12-06_08-17-28.jpg


I've seen different messages too. Different situations, different messages. But I think it gives you the idea.

In above steps both databases have unsaved objects and are not compiled. You can test it while only one of the databases are not compiled. Access doesn't tell you which database is in question.
 

isladogs

MVP / VIP
Local time
Today, 18:31
Joined
Jan 14, 2017
Messages
18,247
@Sun_Force
Thank you for your clear & detailed explanation.
I do hope your normal working practice doesn't use this kind of approach!

Yes doing that does trigger the message .... BUT its not proving anything specific to drag & drop.
You will get EXACTLY the same message if you try to import objects from the database with the unsaved module using the import wizard.
Or indeed if you try to transfer objects by either method from the database with the unsaved form

Until an object is saved it does not appear in the MSysObjects table. Access has no record of it
You should NEVER try to transfer objects from one database to another whilst these contain unsaved objects.
Access will prevent you doing so - that's the point of the error message.


If Access did allow you to do so, there would be far more corrupted databases as a result
The fact that the error message occurs is in my opinion a good thing

However I agree it would be helpful if the message was more specific

NOTE: Once you save the module or other object containing the error, then you can transfer objects successfully using either method
 
Last edited:

Users who are viewing this thread

Top Bottom