Activating and deactivating a FORM

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

Guest

I have a form with a tab control in it. Inside each tab i have one form with
a lot of data. Each time i click on a tab i wish i could unload the other
forms, so they won't be so heavy for my system. And each time i click on a
tab, the form could be active again.

I do not know if i am being clear enough and if this is posible to do.

Thanks a lot!

Lina
 
If you place a subform control directly on the main form (not in a page of
the tab control), you can make the tab control quite squat (just tall enough
for the tabs), and use its Change event to set the SourceObject of the
subform control.

Example:

Private Sub tab1_Change()
With Me.[NameOfYourSubformControlHere]
Select Case Me.tab1.Value
Case 1
.SourceObject = "Form1"
Case 2
.SourceObject = "Form2"
'etc.
End Select
End With
End Sub
 
Thank you Allen. It is doing what i need.
Now what I nees is:
How can I close the sourceObject that I placed in the subform control?

Thanks a lot

Lina

Allen Browne said:
If you place a subform control directly on the main form (not in a page of
the tab control), you can make the tab control quite squat (just tall enough
for the tabs), and use its Change event to set the SourceObject of the
subform control.

Example:

Private Sub tab1_Change()
With Me.[NameOfYourSubformControlHere]
Select Case Me.tab1.Value
Case 1
.SourceObject = "Form1"
Case 2
.SourceObject = "Form2"
'etc.
End Select
End With
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
I have a form with a tab control in it. Inside each tab i have one form
with
a lot of data. Each time i click on a tab i wish i could unload the other
forms, so they won't be so heavy for my system. And each time i click on a
tab, the form could be active again.

I do not know if i am being clear enough and if this is posible to do.

Thanks a lot!

Lina
 
Set the SourceObject to a zero-length string:
Me.[NameOfYourSubformControlHere].SourceObject = ""

BTW, check the LinkMasterFields and LinkChildFields properties. After
setting the SourceObject, Access is likely to assign these whatever it feels
like.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Thank you Allen. It is doing what i need.
Now what I nees is:
How can I close the sourceObject that I placed in the subform control?

Thanks a lot

Lina

Allen Browne said:
If you place a subform control directly on the main form (not in a page
of
the tab control), you can make the tab control quite squat (just tall
enough
for the tabs), and use its Change event to set the SourceObject of the
subform control.

Example:

Private Sub tab1_Change()
With Me.[NameOfYourSubformControlHere]
Select Case Me.tab1.Value
Case 1
.SourceObject = "Form1"
Case 2
.SourceObject = "Form2"
'etc.
End Select
End With
End Sub

message
I have a form with a tab control in it. Inside each tab i have one form
with
a lot of data. Each time i click on a tab i wish i could unload the
other
forms, so they won't be so heavy for my system. And each time i click
on a
tab, the form could be active again.

I do not know if i am being clear enough and if this is posible to do.
 
Thankssss a Lottttt!!!!!

Allen Browne said:
Set the SourceObject to a zero-length string:
Me.[NameOfYourSubformControlHere].SourceObject = ""

BTW, check the LinkMasterFields and LinkChildFields properties. After
setting the SourceObject, Access is likely to assign these whatever it feels
like.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Thank you Allen. It is doing what i need.
Now what I nees is:
How can I close the sourceObject that I placed in the subform control?

Thanks a lot

Lina

Allen Browne said:
If you place a subform control directly on the main form (not in a page
of
the tab control), you can make the tab control quite squat (just tall
enough
for the tabs), and use its Change event to set the SourceObject of the
subform control.

Example:

Private Sub tab1_Change()
With Me.[NameOfYourSubformControlHere]
Select Case Me.tab1.Value
Case 1
.SourceObject = "Form1"
Case 2
.SourceObject = "Form2"
'etc.
End Select
End With
End Sub

message
I have a form with a tab control in it. Inside each tab i have one form
with
a lot of data. Each time i click on a tab i wish i could unload the
other
forms, so they won't be so heavy for my system. And each time i click
on a
tab, the form could be active again.

I do not know if i am being clear enough and if this is posible to do.
 
Allen, it did work perfect.

But now I have to change some things on my forms like the way to filter
things.
For example, i had a function that call a textbox in the form, but now I
acn't access it. I have use this two ways but none of them works a all.

Base = Forms![frm_PPL]![frm_Control]![frm_GrowFactors].Form![Text2]

and this one, i do not even know how to reach the text box.

Base = Formularios![frm_PPL]![frm_Control].Form.Section(0)

Can you help me?

Thanks a lot, Lina


Allen Browne said:
Set the SourceObject to a zero-length string:
Me.[NameOfYourSubformControlHere].SourceObject = ""

BTW, check the LinkMasterFields and LinkChildFields properties. After
setting the SourceObject, Access is likely to assign these whatever it feels
like.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Thank you Allen. It is doing what i need.
Now what I nees is:
How can I close the sourceObject that I placed in the subform control?

Thanks a lot

Lina

Allen Browne said:
If you place a subform control directly on the main form (not in a page
of
the tab control), you can make the tab control quite squat (just tall
enough
for the tabs), and use its Change event to set the SourceObject of the
subform control.

Example:

Private Sub tab1_Change()
With Me.[NameOfYourSubformControlHere]
Select Case Me.tab1.Value
Case 1
.SourceObject = "Form1"
Case 2
.SourceObject = "Form2"
'etc.
End Select
End With
End Sub

message
I have a form with a tab control in it. Inside each tab i have one form
with
a lot of data. Each time i click on a tab i wish i could unload the
other
forms, so they won't be so heavy for my system. And each time i click
on a
tab, the form could be active again.

I do not know if i am being clear enough and if this is posible to do.
 
The name of the subform control has not changed. Assuming that:
- the subform control is named "fSubGeneric", and
- both subforms contains a control named "Text2",
you could still use:
Forms!frm_PPL!fSubGeneric.Form!Text2

If the .Form bit for referring to a form in a subform control is new, see:
http://allenbrowne.com/casu-04.html
 
Allen, thanks a lot for your help.
I have one more question, and that is:

I have a treeview inside the subform control. And when i right click i use
this function:

Public Function mnuAdd()
Screen.ActiveForm.AddRecord
End Function

to open a form to add a record.

Since I am using this subformcontrol and this tab controls I am getting an
error message that says something like this: error define by the application
or object.

How can I access this menu?

Regards, Lina

Allen Browne said:
The name of the subform control has not changed. Assuming that:
- the subform control is named "fSubGeneric", and
- both subforms contains a control named "Text2",
you could still use:
Forms!frm_PPL!fSubGeneric.Form!Text2

If the .Form bit for referring to a form in a subform control is new, see:
http://allenbrowne.com/casu-04.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Allen, it did work perfect.

But now I have to change some things on my forms like the way to filter
things.
For example, i had a function that call a textbox in the form, but now I
acn't access it. I have use this two ways but none of them works a all.

Base = Forms![frm_PPL]![frm_Control]![frm_GrowFactors].Form![Text2]

and this one, i do not even know how to reach the text box.

Base = Formularios![frm_PPL]![frm_Control].Form.Section(0)

Can you help me?

Thanks a lot, Lina
 
No idea, Lina.

AFAIK, forms do not have an AddRecord method, so I don't understand what
this code is supposed to be doing.

Error 2465 means Access doesn't understand it either.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Allen, thanks a lot for your help.
I have one more question, and that is:

I have a treeview inside the subform control. And when i right click i use
this function:

Public Function mnuAdd()
Screen.ActiveForm.AddRecord
End Function

to open a form to add a record.

Since I am using this subformcontrol and this tab controls I am getting an
error message that says something like this: error define by the
application
or object.

How can I access this menu?

Regards, Lina

Allen Browne said:
The name of the subform control has not changed. Assuming that:
- the subform control is named "fSubGeneric", and
- both subforms contains a control named "Text2",
you could still use:
Forms!frm_PPL!fSubGeneric.Form!Text2

If the .Form bit for referring to a form in a subform control is new,
see:
http://allenbrowne.com/casu-04.html
message
Allen, it did work perfect.

But now I have to change some things on my forms like the way to filter
things.
For example, i had a function that call a textbox in the form, but now
I
acn't access it. I have use this two ways but none of them works a all.

Base = Forms![frm_PPL]![frm_Control]![frm_GrowFactors].Form![Text2]

and this one, i do not even know how to reach the text box.

Base = Formularios![frm_PPL]![frm_Control].Form.Section(0)

Can you help me?

Thanks a lot, Lina
 
Hi Allen

What I am trying to do is to have an event on rigth click to open a menu
that offers me the opcions to add or delete a record.

If you kno a better way to do so, please let me know.

Thanks a lot, Lina


Allen Browne said:
No idea, Lina.

AFAIK, forms do not have an AddRecord method, so I don't understand what
this code is supposed to be doing.

Error 2465 means Access doesn't understand it either.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Allen, thanks a lot for your help.
I have one more question, and that is:

I have a treeview inside the subform control. And when i right click i use
this function:

Public Function mnuAdd()
Screen.ActiveForm.AddRecord
End Function

to open a form to add a record.

Since I am using this subformcontrol and this tab controls I am getting an
error message that says something like this: error define by the
application
or object.

How can I access this menu?

Regards, Lina

Allen Browne said:
The name of the subform control has not changed. Assuming that:
- the subform control is named "fSubGeneric", and
- both subforms contains a control named "Text2",
you could still use:
Forms!frm_PPL!fSubGeneric.Form!Text2

If the .Form bit for referring to a form in a subform control is new,
see:
http://allenbrowne.com/casu-04.html
message
Allen, it did work perfect.

But now I have to change some things on my forms like the way to filter
things.
For example, i had a function that call a textbox in the form, but now
I
acn't access it. I have use this two ways but none of them works a all.

Base = Forms![frm_PPL]![frm_Control]![frm_GrowFactors].Form![Text2]

and this one, i do not even know how to reach the text box.

Base = Formularios![frm_PPL]![frm_Control].Form.Section(0)

Can you help me?

Thanks a lot, Lina
 
Could you copy the item from the Formbar's menu for:
Insert | New Record

Or perhaps call a macro, using the RunCommand action, with RecordsGotoNew as
the argument in the lower pane.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lina Manjarres said:
Hi Allen

What I am trying to do is to have an event on rigth click to open a menu
that offers me the opcions to add or delete a record.

If you kno a better way to do so, please let me know.

Thanks a lot, Lina


Allen Browne said:
No idea, Lina.

AFAIK, forms do not have an AddRecord method, so I don't understand what
this code is supposed to be doing.

Error 2465 means Access doesn't understand it either.

message
Allen, thanks a lot for your help.
I have one more question, and that is:

I have a treeview inside the subform control. And when i right click i
use
this function:

Public Function mnuAdd()
Screen.ActiveForm.AddRecord
End Function

to open a form to add a record.

Since I am using this subformcontrol and this tab controls I am getting
an
error message that says something like this: error define by the
application
or object.

How can I access this menu?

Regards, Lina

:

The name of the subform control has not changed. Assuming that:
- the subform control is named "fSubGeneric", and
- both subforms contains a control named "Text2",
you could still use:
Forms!frm_PPL!fSubGeneric.Form!Text2

If the .Form bit for referring to a form in a subform control is new,
see:
http://allenbrowne.com/casu-04.html
message
Allen, it did work perfect.

But now I have to change some things on my forms like the way to
filter
things.
For example, i had a function that call a textbox in the form, but
now
I
acn't access it. I have use this two ways but none of them works a
all.

Base = Forms![frm_PPL]![frm_Control]![frm_GrowFactors].Form![Text2]

and this one, i do not even know how to reach the text box.

Base = Formularios![frm_PPL]![frm_Control].Form.Section(0)

Can you help me?

Thanks a lot, Lina
 
Back
Top