Can you import objects via code?

  • Thread starter Thread starter DRT
  • Start date Start date
D

DRT

I am trying to create a form in MS Access that works similar to Windows
Update (i.e. will check the version of a local form / report and, if
different, will delete it from the local database and then import from a
master). I can get the form to delete using 'DeleteObject' but cannot find
the equivalent command for import ... any suggestions?
 
You could try the DoCmd.CopyObject [destinationdatabase][, newname][,
sourceobjecttype][, sourceobjectname] method.

Hope this helps.
 
Actually the DoCmd.TransferDatabase [transfertype], databasetype,
databasename[, objecttype], source, destination[, structureonly][,
saveloginid] may be of more help as it allows you to import from a database.

Hope this helps.
 
Another approach, rather than swapping objects in and out of an Access file,
is to swap the entire Access file out and replace it with an updated
version.

That way, any (and all) changes you've made (and tested) will be
available...

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks all for the response, should be able to get something working now :)

Andrew Tapp said:
Actually the DoCmd.TransferDatabase [transfertype], databasetype,
databasename[, objecttype], source, destination[, structureonly][,
saveloginid] may be of more help as it allows you to import from a database.

Hope this helps.

DRT said:
I am trying to create a form in MS Access that works similar to Windows
Update (i.e. will check the version of a local form / report and, if
different, will delete it from the local database and then import from a
master). I can get the form to delete using 'DeleteObject' but cannot find
the equivalent command for import ... any suggestions?
 
Back
Top