Appending objects to collections

ajetrumpet

Banned
Local time
Yesterday, 20:54
Joined
Jun 22, 2007
Messages
5,638
IT pros,

Sometimes when I use the append method in Visual Basic, regardless of the object that I am working with, I will see the object icon appear in the database window, but sometimes I will not. Can anyone offer an explanation as to why this occurs? Appending an object to a collection will not do the job alone.

I guess I am saying that I'm not sure of the coding I once used to make it happen. Thanks!
 
I think you have to "append" "and then refresh. I'm not sure I haven't done it myself I'm just working from what I have read in this site.
 
Not sure I'm good at the explanation stuff, but what you do in VBA isn't necessarily supposed to be immediately visible in the interface - think of it - the user isn't even supposed to see the database window ;-)

But, say you append a field to a table, next time you open it in design view (or any other view), the field would normally be there.

Sometimes you'll even need to refresh collections, after an append or delete, to be able to continue to work with new/altered objects, but that's only applying to the objects you're working with - say tdf.Refresh().

Say you've fetched a database object through the dbengine(0)(0) method, which doesn't refresh the collections as currentdb() does, then you do some alterations, and need access to it, you'd probably need to refresh the relevant collection(s) to continue working.

To be sure the changes are also propagated to the UI/database window, there's the RefreshDatabaseWindow() method of the application object (same as F5, I guess).
 
To be sure the changes are also propagated to the UI/database window, there's the RefreshDatabaseWindow() method of the application object (same as F5, I guess).
That's it Roy. Thank you!

This works:
Code:
RefreshDatabaseWindow
This does not:
Code:
(current)db.RefreshDatabaseWindow
Got it in my notes now.
 

Users who are viewing this thread

Back
Top Bottom