Editing Sub Forms

G

Guest

I have a general information form that displays names, addresses etc from the
"Customers Table and I also have a sub form "frm_sub_ExtraInfo" that I
display in the main form. Both forms get their inf from the Cutomers Table.
The "Extra Info" is in a sub form because I want to hide or show all the
information easily and without going through a routine of fiealdname.visible
= True / False over and over again. Just doing "frm_sub_ExtraInfo.visible =
True / False" does everything for me.

All works well until I want to edit the fields. The expression Me.allowEdits
= True / False, allows me to make changes to the main form but not to the sub
form. trying to be specific to the sub form with the expression
frm_sub_ExtraInfo.AllowEdits = True and then I have tried
Form.frm_sub_ExralInfo.AllowEdits = True but I get errors like "Data Member
not found" which means I am usinf the wrong wording somewhere. Can anyone
help?
Thanks RayC
 
R

Rick Brandt

Ray said:
I have a general information form that displays names, addresses etc
from the "Customers Table and I also have a sub form
"frm_sub_ExtraInfo" that I display in the main form. Both forms get
their inf from the Cutomers Table. The "Extra Info" is in a sub form
because I want to hide or show all the information easily and without
going through a routine of fiealdname.visible = True / False over and
over again. Just doing "frm_sub_ExtraInfo.visible = True / False"
does everything for me.

All works well until I want to edit the fields. The expression
Me.allowEdits = True / False, allows me to make changes to the main
form but not to the sub form. trying to be specific to the sub form
with the expression frm_sub_ExtraInfo.AllowEdits = True and then I
have tried Form.frm_sub_ExralInfo.AllowEdits = True but I get errors
like "Data Member not found" which means I am usinf the wrong wording
somewhere. Can anyone help?
Thanks RayC

Having two forms bound to the same record will cause all kinds of conflicts when
editing, but you can get what you want without a subform.

Instead of a subform use a TabControl with a single TabPage and with the
TabStyle set to "None". Showing/Hiding the TabControl will still Hide/Show all
the controls on the control with a simple command, but you won't have the
problems that using a subform cause.
 
G

Guest

Hi Rick thanks for the response.
It may be out of my ignorance of the use of Tabs but I don't think that this
solves my problem. My current form has a number of "Find" Combo Boxes allong
with a number of Text boxes for the general information like name, address
etc. The extra info is what I want to show or hide at various stages of the
Form's use. If my understaning of Tabs is correct, I would need to have a
duplicate form with the "Find" Combo Boxes and all of the general information
on both Forms and one of the forms with all of the Extra Info Text Boxes.
Duplicating all of theose boxes does not sound like a good idea.

RayC
 
R

Rick Brandt

RayC said:
Hi Rick thanks for the response.
It may be out of my ignorance of the use of Tabs but I don't think
that this solves my problem. My current form has a number of "Find"
Combo Boxes allong with a number of Text boxes for the general
information like name, address etc. The extra info is what I want to
show or hide at various stages of the Form's use. If my understaning
of Tabs is correct, I would need to have a duplicate form with the
"Find" Combo Boxes and all of the general information on both Forms
and one of the forms with all of the Extra Info Text Boxes.
Duplicating all of theose boxes does not sound like a good idea.

It would appear your understanding of TabControls is not correct. They are
nothing more than a way to control the real estate on your form. If you make a
TabControl with a single page then it essentially becomes a frame with controls
on it. If you hide the frame you will also hide all the controls on it.

If hiding/showing a subform (essentially a rectangular area on your form) then
hiding/showing a TabControl should also work. There is no reason why you would
need two forms. You would just take the controls that are currently on your
subform and duplicate those on your main form, but also placing them onto the
TabControl page.
 
G

Guest

Hi Rick

I now have a Tab that contains all of the Text Boxes that were in my "Sub
Form" and I can Hide or Show that Tab, Great! However the Tab shows as ans
ALL WHITE box and I want it to blend in with the rest of the form. I can not
find any properties to set the Back colour of the Tab, is there any way to do
that?
Regards RayC
 
R

Rick Brandt

RayC said:
Hi Rick

I now have a Tab that contains all of the Text Boxes that were in my
"Sub Form" and I can Hide or Show that Tab, Great! However the Tab
shows as ans ALL WHITE box and I want it to blend in with the rest of
the form. I can not find any properties to set the Back colour of the
Tab, is there any way to do that?
Regards RayC

Set the BackStyle property to Transparent.
 
J

John Nurick

IIRC this can happen if you're using Windows XP, Access 2003 and have
selected Use Windows Themed Controls on Forms.
 
G

Guest

Using XP, never heard of "Use Windows Themes on Forms" where is it and how
can I turn it off?

Thanks RayC
 
G

Guest

Hi John

Forget my last e-mail. I found it, turned it off and all looks good at the
moment.

Deeply gratefull for all your help.
Ray C
 
J

John Nurick

Glad it's working. Thanks for the feedback.

Hi John

Forget my last e-mail. I found it, turned it off and all looks good at the
moment.

Deeply gratefull for all your help.
Ray C
 

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

Similar Threads

Access Sub form opens before the main form in MS Access 0
Sub Forms 7
Embeded Forms 11
ByPass key ms access 2016 0
Access Passing data from a form to another form! 0
Information in sub form 1
Allow Edits 8
Run-time Error 2585: Unable to Close Form 2

Top