Opening a Form

A

Amateur

Dear Sirs,
I have a Form n one Database (DB1) which I open with a command button in
another database (DB2) - it is working well.

In DB1 I have a Module like this:

Public Sub OpenStatements()
DoCmd.OpenForm "statements"
End Sub

In DB I have the following VB in my command button to open the form:

Private Sub OpenstatementsForm_Click()
Openstatements
End Sub

Now I would like that the Form from DB1 is Opening as a subform in DB2:
Can someone help me with the code?
Thanks
Klaus
 
A

Amateur

Jeff

I have two databases (say DB1 and DB2).
I have two Forms (one in DB1 and one in DB2)
I am opening the Form from DB1 with a command button in a Form in DB2.
The code which I gave in my original question is working - but - I would
like that the Form from DB1 is opening In DB2 like a subform with a button
click.

If I would like to open with a command button a Form as a subform I use the
following code (but that is if the Form and the subform is in the same
Database):
Private Sub Command32_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "anyform
Me.[dummyform2].SourceObject = "anyform"
End Sub

Somehow, I think, I have to combine those two codes for opening a form as a
subform in another DB Form.

Thanks for your help
Klaus
 
J

Jeff Boyce

Perhaps one of the other newsgroup readers has done this, I haven't.

Is there a chance you could link from DB1 to DB2 and get the table(s) linked
in, so you could keep all the forms in one DB?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Amateur said:
Jeff

I have two databases (say DB1 and DB2).
I have two Forms (one in DB1 and one in DB2)
I am opening the Form from DB1 with a command button in a Form in DB2.
The code which I gave in my original question is working - but - I would
like that the Form from DB1 is opening In DB2 like a subform with a button
click.

If I would like to open with a command button a Form as a subform I use the
following code (but that is if the Form and the subform is in the same
Database):
Private Sub Command32_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "anyform
Me.[dummyform2].SourceObject = "anyform"
End Sub

Somehow, I think, I have to combine those two codes for opening a form as a
subform in another DB Form.

Thanks for your help
Klaus


Jeff Boyce said:
Klaus

Just to make sure we're using the same terminology...

Do you have two separate .mdb files (in Access, this is two databases), or
two tables in a single .mdb file?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
A

Amateur

No, I cannot put all the forms in one database.
Anyway Jeff, I thank you very much for trying to help me.
I will post this again now, maybe someone else can help.
Klaus

Jeff Boyce said:
Perhaps one of the other newsgroup readers has done this, I haven't.

Is there a chance you could link from DB1 to DB2 and get the table(s) linked
in, so you could keep all the forms in one DB?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Amateur said:
Jeff

I have two databases (say DB1 and DB2).
I have two Forms (one in DB1 and one in DB2)
I am opening the Form from DB1 with a command button in a Form in DB2.
The code which I gave in my original question is working - but - I would
like that the Form from DB1 is opening In DB2 like a subform with a button
click.

If I would like to open with a command button a Form as a subform I use the
following code (but that is if the Form and the subform is in the same
Database):
Private Sub Command32_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "anyform
Me.[dummyform2].SourceObject = "anyform"
End Sub

Somehow, I think, I have to combine those two codes for opening a form as a
subform in another DB Form.

Thanks for your help
Klaus


Jeff Boyce said:
Klaus

Just to make sure we're using the same terminology...

Do you have two separate .mdb files (in Access, this is two databases), or
two tables in a single .mdb file?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Dear Sirs,
I have a Form n one Database (DB1) which I open with a command button in
another database (DB2) - it is working well.

In DB1 I have a Module like this:

Public Sub OpenStatements()
DoCmd.OpenForm "statements"
End Sub

In DB I have the following VB in my command button to open the form:

Private Sub OpenstatementsForm_Click()
Openstatements
End Sub

Now I would like that the Form from DB1 is Opening as a subform in DB2:
Can someone help me with the code?
Thanks
Klaus
 

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