Template form for CreateForm

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.
 
J

John Nurick

Hi Marie,

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

Marie

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.
.
 
J

John Nurick

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.
.
 

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