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

Sun_Force

Active member
Local time
Tomorrow, 00:27
Joined
Aug 29, 2020
Messages
396
@Sun_Force
I do hope your normal working practice doesn't use this kind of approach!
While I don't understand what you mean by "This kind of approach", but I have bad news. I use drag & drop objects between my apps frequently. I have a lot of objects that are shared between my databases. login form, search forms, print forms, modules, etc.
If I change the design of a form or a function, I simply drag and drop it into other applications to have the same results in all of them.

For example, I have a module containing several functions that receive a table name, a filter, and a report name, creates a pdf of the results, zip and password protect the pdf, creates a new mail with a certain body, adds the recipients and attach the protected zip to the mail.
If I change my mind and decide to change the length or complexity of the password, I change the appropriate function, and drag the whole module to my other databases.

@Sun_Force
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.
I didn't try to prove anything. Me and @Pat Hartman (#20) explained you will receive an error if the object is opened or unsaved. You couldn't replicate the error message and I simply explained how to replicate it.
Sometimes I'm working on several objects and forget to save one of them, specially if it's a module. then I receive the error.

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
You're getting me wrong.
I don't expect Access to copy an unsaved object to another database. I only expect Access to warn me which object is causing the error. (which you accepted it could be helpful)
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 16:27
Joined
Jan 14, 2017
Messages
18,219
I'm not trying to disagree with you or Pat
Its good to know that you frequently use this method of transferring objects.
Most developers don't do so & many had never heard of the method

'This kind of approach' was a reference to trying to transfer objects from databases where one or more objects haven't been saved

All I was pointing out that the error message is nothing to do with using drag & drop itself
Access prevents you transferring objects by any method where there is an object that has not been saved.

As already stated, I have no difficulty transferring open objects .... provided any changes have been saved
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
I am very careful about saving objects as I change them. Once you've been burned by loosing an hour or two of work if Access shuts down because it is mad at you or the power goes out, you tend to be ultra careful. I even have backups automatically created when I close the FE if I have modified any object. That's how paranoid I am. My point was that even using best practices, you can run into the error if Access is behind in writing to disk. Sun was just showing you how to make the error happen.
 

isladogs

MVP / VIP
Local time
Today, 16:27
Joined
Jan 14, 2017
Messages
18,219
From bitter experience with power failures etc, I'm also obsessive/paranoid about saving objects on a regular basis.
That may explain why I had never until now seen the error message when transferring database objects either using the wizard, drag & drop or copy & paste.

As I expected, further testing indicates that the error only occurs when the 'source' database contains one or more unsaved objects.
It doesn't appear to matter whether the destination database has any unsaved objects.

On repeated testing, I did occasionally find that after getting the error message when I tried to transfer one or more saved objects (using either method) from a db with unsaved objects, the file lock wasn't immediately released after those objects were saved. It is in those cases that you may need to close & reopen the database...or just wait a few seconds for the lock to be released

BUT as I keep saying, that same point applies whether using the wizard, drag & drop or copy & paste to transfer the object..
In each case, Access is deliberately protecting against possible corruption
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
As I expected, further testing indicates that the error only occurs when the 'source' database contains one or more unsaved objects.
It doesn't appear to matter whether the destination database has any unsaved objects.
All I said was that you could get an error even when you thought that all objects had been saved because Access was behind in its disk writes. And you have now confirmed that for yourself:)
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
So @Jon, can we have a dedicated Forum for Tips and Tricks?
I hadn't commented on this discussion because I wanted to see it play out first. It seems like the binary idea of having either a Tips and Tricks section or not might blind us to seeing a third way: renaming the Access FAQ section to Access Tips, Tricks and FAQs. Just a thought.

Let me know your opinions.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
@Jon, can the forums have subdivisions? I don't find the search features to be useful. I never find what I'm looking for even when I know what key words to use and no one is going to read through hundreds or thousands of threads looking for something helpful. I would like to see the samples and tips/tricks/FAQ subdivided so that people can narrow their search or simply browse in an area of interest.

Also, moderators have to be much better about moving questions out of the "FAQ" type sections.

Moderators can do the moving as they have time. Just add an unclassified section and over time, we'll move those items somewhere more relevant.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
@Pat Hartman It depends on what you mean by subdivisions. Do you have a forum example that shows what you mean or how the layout would be?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
This is the main outline of the forum, I broke down the MS Access reference to the next. Each of the first four items needs to be broken down further to a third level into the same categories as we see under MS Access Discussion.
Code:
Access World
Microsoft Access Discussion
Excel and other spreadsheets
Moderator Area
Private Members Area
Microsoft Access Reference
    Access FAQ
    Code Repository
    Sample Databases
    Microsoft Access Tutorials
    Microsoft Access User Groups
Apps and Windows
Non-Access Issues
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
I understand what you mean by the structural arrangement. But I am talking about layout examples of what you might have envisioned, hence asking if you had any forum examples that already exist.
 

oleronesoftwares

Passionate Learner
Local time
Today, 08:27
Joined
Sep 22, 2014
Messages
1,159
Its a No for me.

Reason most questions asked in all threads are actually asking for either tips and tricks to solve a problem.

Tips and tricks is a bit vague, a user or guest will look for threads that has similar questions or challenges he/she is facing , and not neccesarily
tips and tricks.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
That is why I suggested having a lower break down but the breakdown should also exist for sample databases and code samples.

FAQ should be more curated. Right now it is a catch all and too many people post questions there. I've been moving them out but I don't know if other moderators are also. Most of what is in the section is just questions and that was not the intent.

But I am talking about layout examples of what you might have envisioned
I don't understand. Are you asking of the lower sub groups should always be visible? I don't think so, it makes the list too long and confusing since many sub categories will have the same list of sub-sub categories. So, I think clicking on the sub-category should open another list. Or, if you can make levels 1 and 2 expandable also, that would make them consistent. That way it could work like the Navigation pane in Access. It just shows the five object types or if you click on tables, it shows tables plus all the tables and then it shows the other four groups closed but you can click to open all groups. The difference is that the Access Navigation Pane is just one grouping level and then detail. I'm suggesting three levels of grouping before you get to the details.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
There are setups like this, which is what I presume you mean?

1640963869789.png


Example subforum:

1640963906693.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
Those look like they are only two tier which is what we currently have. Will the software do a third tier so that within Samples, for example, we can have Forms, Reports, Queries, etc and with in Code we can have Forms, Reports, Queries, etc? I would like something like a treeview that can expand and contract.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
Let me provide a more zoomed out view so you can see there are indeed 3 tiers. I am reluctant to have two many things that increases the need to scroll down.

1640966799514.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
Technically, we need four. Three group levels and the detail. But I prefer the tightness of the Home audio section.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 16:27
Joined
Sep 28, 1999
Messages
7,395
I've had a look at the Access FAQ, Code Repository etc sections and there are very few posts there. I am not sure it is worth the vertical overhead for an infrequently used section of the site. Adding multiple sublayer will increase the scrolling required to get to the other areas.
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:27
Joined
Feb 19, 2002
Messages
43,268
The reason they are not used is because those type forums are like black holes. It is way too hard to find stuff related to your area of interest. I can't even find samples I've posted and I know the keywords.
 

Users who are viewing this thread

Top Bottom