Forms and subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)
 
Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


Ofer Cohen said:
On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


Amateur said:
I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


Amateur said:
Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


Ofer Cohen said:
On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


Amateur said:
I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
My mistake, I did not explain good enough - sorry.
Yes, I know I can open a form with a command button.
So, I have a main form with customer details - than I need for our business
three more forms to create an offer. 1st form for a cemetery offer, 2nd form
for a normal gardening offer and the 3rd form for a normal plants offer.
The layout would be much nicer if I use three command buttons which are
opening the specific forms in the main form (like a subform).
If that is not possible than I have to create three seperate forms and use
your 1st idea for the main form.
My question was if it is possible, and how it is possible, to open with a
command button, instead of a seperate form a subform in the main form.
Thanks
Klaus

Ofer Cohen said:
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


Amateur said:
Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


Ofer Cohen said:
On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


:

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
One option will be to use a Tab in the form and dispaly a sub form in each Tab

Second option, you can have one sub form control on the form, and using the
button you can change the sub form in that control

Me.[SubFormControlName].SourceObject = "SubFormName"

--
Good Luck
BS"D


Amateur said:
My mistake, I did not explain good enough - sorry.
Yes, I know I can open a form with a command button.
So, I have a main form with customer details - than I need for our business
three more forms to create an offer. 1st form for a cemetery offer, 2nd form
for a normal gardening offer and the 3rd form for a normal plants offer.
The layout would be much nicer if I use three command buttons which are
opening the specific forms in the main form (like a subform).
If that is not possible than I have to create three seperate forms and use
your 1st idea for the main form.
My question was if it is possible, and how it is possible, to open with a
command button, instead of a seperate form a subform in the main form.
Thanks
Klaus

Ofer Cohen said:
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


Amateur said:
Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


:

On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


:

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
CONTINUATION:
Maybe I can explain my above post easier.
Is it possible to use the main form like a frame page (Like in Front page)
so that those forms can open in the frame?

Amateur said:
My mistake, I did not explain good enough - sorry.
Yes, I know I can open a form with a command button.
So, I have a main form with customer details - than I need for our business
three more forms to create an offer. 1st form for a cemetery offer, 2nd form
for a normal gardening offer and the 3rd form for a normal plants offer.
The layout would be much nicer if I use three command buttons which are
opening the specific forms in the main form (like a subform).
If that is not possible than I have to create three seperate forms and use
your 1st idea for the main form.
My question was if it is possible, and how it is possible, to open with a
command button, instead of a seperate form a subform in the main form.
Thanks
Klaus

Ofer Cohen said:
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


Amateur said:
Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


:

On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


:

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
Dear Ofer,
Sorry, I don't want to go on your nervs but your

Me.[SubFormControlName].SourceObject = "SubFormName"
I changed like this:
Me.[cemeteryoffer].SourceObject = "gardenoffer"

cemeteryoffer is the subform already open in the main form. gardenoffer
should open in the same place at cemeteryoffer if I click the command button.
Can you tell me what is wrong with my code because nothing happens, not even
an error message.
Thanks
klaus
Ofer Cohen said:
One option will be to use a Tab in the form and dispaly a sub form in each Tab

Second option, you can have one sub form control on the form, and using the
button you can change the sub form in that control

Me.[SubFormControlName].SourceObject = "SubFormName"

--
Good Luck
BS"D


Amateur said:
My mistake, I did not explain good enough - sorry.
Yes, I know I can open a form with a command button.
So, I have a main form with customer details - than I need for our business
three more forms to create an offer. 1st form for a cemetery offer, 2nd form
for a normal gardening offer and the 3rd form for a normal plants offer.
The layout would be much nicer if I use three command buttons which are
opening the specific forms in the main form (like a subform).
If that is not possible than I have to create three seperate forms and use
your 1st idea for the main form.
My question was if it is possible, and how it is possible, to open with a
command button, instead of a seperate form a subform in the main form.
Thanks
Klaus

Ofer Cohen said:
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


:

Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


:

On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


:

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
Thanks for your help - problem solved it's working


Ofer Cohen said:
One option will be to use a Tab in the form and dispaly a sub form in each Tab

Second option, you can have one sub form control on the form, and using the
button you can change the sub form in that control

Me.[SubFormControlName].SourceObject = "SubFormName"

--
Good Luck
BS"D


Amateur said:
My mistake, I did not explain good enough - sorry.
Yes, I know I can open a form with a command button.
So, I have a main form with customer details - than I need for our business
three more forms to create an offer. 1st form for a cemetery offer, 2nd form
for a normal gardening offer and the 3rd form for a normal plants offer.
The layout would be much nicer if I use three command buttons which are
opening the specific forms in the main form (like a subform).
If that is not possible than I have to create three seperate forms and use
your 1st idea for the main form.
My question was if it is possible, and how it is possible, to open with a
command button, instead of a seperate form a subform in the main form.
Thanks
Klaus

Ofer Cohen said:
What do you mean by openning a sub form?

You can make it visible, if it's already linked to the main form
Me.[SubFormControlName].Visible = True

Or, open it as a seperate form
Docmd.OpenForm "SubFormName"

--
Good Luck
BS"D


:

Following your answer I have another question.
Is it than as well possible to open a subform in the main form with a
command of a command button?
If yes, can you as well tell me how?
Thanks
Klaus


:

On the form LoadEvent you can use this code

Me.[SubFormControlName].Visible =
(Me.[SubFormControlName].Form.RecordSetClone.RecordCount > 0)

--
Good Luck
BS"D


:

I have a form where I would like to integrate subforms. (OK, no problem)
I would like that, if I have i.e. subforms, 1,2 and 3, only that subform is
shown where as well data is in. Empty subforms I don’t want to see.

Is that possible and if yes, how?
Thanks
Klaus
 
Back
Top