Template form for CreateForm

  • Thread starter Thread starter Marie
  • Start date Start date
M

Marie

I have a database DB1 that creates a form in another
database MyDB (like a wizard).

I use the following code

Dim AppAcc As New Access.Application
AppAcc.OpenCurrentDatabase "C:\MyDB.mdb"
AppAcc.CreateForm , "FMmaster"

FMmaster is a form in DB1 with size and other properties
set to match the use.

But it doesn't work. I can create a form in MyDB - but it
is not based om FMmaster.

What is wrong?

I have also tried to have the master in MyDB - but that
didn't work either.
 
Hi Marie,

Why not just use DoCmd.TransferDatabase (in DB1) to copy the "template"
form from DB1 to MyDB?
 
John,

That actually works. Good idea.

Two more questions:
1. How do I delete a form in MyDB from code in DB1?
2. How do I "send to back" on a control from VBA? - It is
normally done with the edit menu.

Marie
-----Original Message-----
Hi Marie,

Why not just use DoCmd.TransferDatabase (in DB1) to copy the "template"
form from DB1 to MyDB?

I have a database DB1 that creates a form in another
database MyDB (like a wizard).

I use the following code

Dim AppAcc As New Access.Application
AppAcc.OpenCurrentDatabase "C:\MyDB.mdb"
AppAcc.CreateForm , "FMmaster"

FMmaster is a form in DB1 with size and other properties
set to match the use.

But it doesn't work. I can create a form in MyDB - but it
is not based om FMmaster.

What is wrong?

I have also tried to have the master in MyDB - but that
didn't work either.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Marie,

I never try to do this sort of thing so am guessing, but presume that it
would be with stuff like
AppAcc.RunCommand acCmdDelete
AppAcc.RunCommand acCmdSendToBack
though of course you need to select the form or control in question
first.


John,

That actually works. Good idea.

Two more questions:
1. How do I delete a form in MyDB from code in DB1?
2. How do I "send to back" on a control from VBA? - It is
normally done with the edit menu.

Marie
-----Original Message-----
Hi Marie,

Why not just use DoCmd.TransferDatabase (in DB1) to copy the "template"
form from DB1 to MyDB?

I have a database DB1 that creates a form in another
database MyDB (like a wizard).

I use the following code

Dim AppAcc As New Access.Application
AppAcc.OpenCurrentDatabase "C:\MyDB.mdb"
AppAcc.CreateForm , "FMmaster"

FMmaster is a form in DB1 with size and other properties
set to match the use.

But it doesn't work. I can create a form in MyDB - but it
is not based om FMmaster.

What is wrong?

I have also tried to have the master in MyDB - but that
didn't work either.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top