
Open different database file within Access using code
Daniel:
Goto http://www.*-*-*.com/ #8 and see it MichKa's free TSI SOON
add-in will do what you want.
--
Bruce M. Thompson, Microsoft Access MVP
Quote:
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<
Quote:
> Geoff
> Thanks for your suggestion.
> Sorry if my previous message didn't make this clear - but I actually want to
> open the new database within Access, as if the user had selected the
> 'File/Open..' menu option, ie new database replaces current database and
> startup form loads.
> I tried the following code:
> Dim objWS As DAO.Workspace
> Dim objDB As DAO.Database
> Set objWS = DBEngine(0)
> Set objDB = objWS.OpenDatabase("otherdb.mdb")
> However this doesn't actually load the database into the Access window. It
> does give you a reference to the mdb database, which you could use to open
> recordsets and work with data in the database - is this what you thought I
> wanted to do?
> If you have any further ideas, please let me know.
> Thanks again
> Daniel