Rename a form in externat DB

  • Thread starter javiernews via AccessMonster.com
  • Start date
J

javiernews via AccessMonster.com

Hi,

I need to rename an external DB but I would like to use OpenDatabase metod
but I got an error

Sample:
Dim accAppNew As New Access.Application
Dim dbs As DAO.Database

Set dbs = accAppNew.DBEngine.OpenDatabase("C:\My Doduments\Test.
mdb", True, False)
accAppNew.Visible = False

dbs.DoCmd.Rename "NewForm", acForm, "OldForm" ' <<< Error

Is it possible to rename a Form using OpenDatabase method ?


Thank you !
 
J

javiernews via AccessMonster.com

Sorry Alex for late replay.

I tried like this,

I changed
Dim dbs As DAO.Database
for
Dim dbs As Access.Application

but appears this error: Error Run'Time error 13 Type mismatch

:·(((
 
J

javiernews via AccessMonster.com

I would like to use OpenDatabase (read first post) Not OpenCurrentDatabase
method.
 
A

Alex Dybenko

OpenDatabase is a method of DBEngine, and OpenCurrentDatabase is a method of
Access.Application. As we need to get access to DoCmd object - we need to
initiate Access.Application and run OpenCurrentDatabase method there

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top