rename a form in an external database

  • Thread starter Thread starter Question Boy
  • Start date Start date
Q

Question Boy

Is there a way to rename an object, a form, in an external database?

I tried

Dim db As DAO.Database
Set db = OpenDatabase("C:\BAD\BAD 1.0.mdb")
With db.Containers("Forms").Documents("frm_Invoicing_Items")
.Name = "newname"
End With
db.Close
Set dbA = Nothing

But it keeps spitting out an error about being read only when the help file
states it can be used to set the value?!

I know I can use the following statement in the current db, but do not know
how to adapt it to work on a remote db.
DoCmd.Rename "frm_Invoicing_Items1", acForm, "frm_Invoicing_Items"

Thank you for your help,

QB
 
Question Boy said:
Is there a way to rename an object, a form, in an external database?

I tried

Dim db As DAO.Database
Set db = OpenDatabase("C:\BAD\BAD 1.0.mdb")
With db.Containers("Forms").Documents("frm_Invoicing_Items")
.Name = "newname"
End With
db.Close
Set dbA = Nothing

But it keeps spitting out an error about being read only when the help
file
states it can be used to set the value?!

I know I can use the following statement in the current db, but do not
know
how to adapt it to work on a remote db.
DoCmd.Rename "frm_Invoicing_Items1", acForm, "frm_Invoicing_Items"

Thank you for your help,

QB

You can use DoCmd via automation by prefixing it with a variable set to the
db's Application object:

App.DoCmd.Rename ...

(untested idea)
 
It connect an execute the code, but returns an error because the vbe is
password protected and it states that I must supply the password. How can I
get around that?

QB
 
Back
Top