main form, sub form, sub sub form ...etc

D

DawnTreader

Help!

i am working on a major component of our companies service department
database and need some help with forms and sub forms.

i have a picture to show what i am doing. see this pic:

http://img156.imageshack.us/my.php?image=formsubformsubsubformpinx0.jpg

it shows the layout of the screen that i am creating to be able to enter in
all the data pertaining to the machines we build.

the problem is with some code that i am building in the red boxed subform to
update the blue box subform.

this is the code, borrowed from a tip site:

Private Sub Form_AfterUpdate()

Forms!subfrmUnitsAddressEquipDetails.subfrmDecendingRunningHoursatDate.Form.Requery
End Sub

it worked untili i moved the subform to being a subsubform.

another question on this topic is, how many layers can i go?
 
M

Marshall Barton

DawnTreader said:
i am working on a major component of our companies service department
database and need some help with forms and sub forms.

i have a picture to show what i am doing. see this pic:

http://img156.imageshack.us/my.php?image=formsubformsubsubformpinx0.jpg

it shows the layout of the screen that i am creating to be able to enter in
all the data pertaining to the machines we build.

the problem is with some code that i am building in the red boxed subform to
update the blue box subform.

this is the code, borrowed from a tip site:

Private Sub Form_AfterUpdate()

Forms!subfrmUnitsAddressEquipDetails.subfrmDecendingRunningHoursatDate.Form.Requery
End Sub

it worked untili i moved the subform to being a subsubform.

another question on this topic is, how many layers can i go?


The referencing logic is:

Forms!mainform.subform.Form.subsubform.Form.Requery

It's one of those things that must be changes when you
change the structure of the form and its subforms.

You can go seven levels deep with subforms. Prior to A2000
its was three levels.
 
D

DawnTreader

Hello

i kind of figured it was something like that. here is the next problem, do i
reference the subsubform that i want to refresh, or do i reference the
subsubform causing the situation?

i have tried the subsubform that i want to refresh, it doesnt seem to work.
it does when i enter a new record, but when i delete the record it doesnt. is
there a particular place i should put this, "After update" or "before" or "on
lost focus"?

in the picture, the subsubform in the red box is a data entry spot that
should cause the blue box to be refreshed. the blue box is based on a query
based on the table. the red box is based on the same table that the query of
the blue box is based on. the green box is based on the same table that the
main form is. the need was to have more tabs on the equipment details tab. i
am starting to think about other ways to do what we are trying to do here.
 
M

Marshall Barton

You place the code in the subsubform that is causing the
situation and the code needs to reference the form you are
trying to requery. In this case you could avoid making the
code dependent on the names of the mainform and subform by
using this kind of reference (in the red subsubform):
Parent.bluesubsubform.Form.Requery

I don't think you've explained what activities are causing
the requery. If it's editing an existing record or adding a
new record, the requery should probably be in the red form's
AfterUpdate event. I haven't tried doing this kind of thing
when a record is deleted, but if the AfterUpdate event
doesn't do it, try the AfterDelConfirm event.
 
D

DawnTreader

Hello again

well i have to say that your information helped.

but there has been a major revision.

have a look at the example layout i am working on:

http://img156.imageshack.us/img156/1999/formsubformsubsubformpinx0.jpg

i already know how to cause the compressor and dispenser level of tabs to
show and hide at will. but i need to be able to do that and have all the
compressors at the site show on the next set of tabs below, according to the
data within a table. i want the -Unit #?- tabs to be the records for each
machine that is at the site. that unit number will end up coresponding to the
actual serial number of the machines at the site.

i hope this makes sense, and that some one can help out.
 
M

Marshall Barton

I hope I didn't understand what you want with this latest
twist. It almost sounds like you want to use tabs as a
filtering mechanism to select the record for a specific
unit. If that really is what you're thinking, give it up,
it's just a really bad idea to try to manipulate a design
time object in this way.

What don't you like about the more traditional data driven
controls such as a combo box, list bos or even a continuous
subform?
 
D

DawnTreader

Hello

wow. i never thought someone would put a stopper on what access can do. i
know that it is some high ideals that i had but i didnt think access would be
incapable.

ouch.

ah, i just realized that i may have put up the wrong link for the picture i
was trying to show.

http://img170.imageshack.us/my.php?image=newformlayoutquestionsvs5.jpg

now that i am over the initial shock, i guess i will have rethink the idea
that i had and keep my ideas to a level that i know access can do.

just so i understand, to do what i was thinking isnt possible? or is it
really complicated? does access 2007 have features that would allow this?

so to do what i need i guess i would have to have a subform under the
compressor tab that pulled the information and allowed the user to use the
navigation buttons. and a subform on that that had the tabs for the dates,
part detail, etc.

my data structure has changed and now pulling the data is a little more
complicated.

is there a way to get a form that pulls from any table and puts it anywhere
i want? i want to be able to allow for additions to the tables and editing of
the records as well, not just a form that "looks" at things. my biggest
problem is the constraint of the way the data has to be in a form, subform,
fashion.

Marshall Barton said:
I hope I didn't understand what you want with this latest
twist. It almost sounds like you want to use tabs as a
filtering mechanism to select the record for a specific
unit. If that really is what you're thinking, give it up,
it's just a really bad idea to try to manipulate a design
time object in this way.

What don't you like about the more traditional data driven
controls such as a combo box, list bos or even a continuous
subform?
--
Marsh
MVP [MS Access]

well i have to say that your information helped.

but there has been a major revision.

have a look at the example layout i am working on:

http://img156.imageshack.us/img156/1999/formsubformsubsubformpinx0.jpg

i already know how to cause the compressor and dispenser level of tabs to
show and hide at will. but i need to be able to do that and have all the
compressors at the site show on the next set of tabs below, according to the
data within a table. i want the -Unit #?- tabs to be the records for each
machine that is at the site. that unit number will end up coresponding to the
actual serial number of the machines at the site.

i hope this makes sense, and that some one can help out.
 
M

Marshall Barton

I didn't say it can't be done, I said it's a bad idea. What
are you going to do if you land a big contract and get a
customer with 100 compressors? I don't even know what the
limit on the number of tabs is, but more than 10 or so will
start to look pretty awful.

The trick to doing it is to add a bunch of tabs (at design
time) and make them invisible. When a machine type is
selected, use a code procedure that uses the units subform's
recordset clone (or open a recordset on the customer's unit
data), make each needed tab visible and set its caption to
the unit id.

All that sounds like a big mess to me and I strongly
recommend using a different mechanism to select a unit.

As an aside, do you really need all those record selectors
and navigation bars or is this just a quicky prototype?
 
D

DawnTreader

hello

yeah. i kinda figured i was over my head. and yeah that was just a quick
prototype to see how i "might" arrange the data.

the great thing is that my boss, who makes the final decision about the
"look" didnt like the prototype anyways.

Marshall Barton said:
I didn't say it can't be done, I said it's a bad idea. What
are you going to do if you land a big contract and get a
customer with 100 compressors? I don't even know what the
limit on the number of tabs is, but more than 10 or so will
start to look pretty awful.

The trick to doing it is to add a bunch of tabs (at design
time) and make them invisible. When a machine type is
selected, use a code procedure that uses the units subform's
recordset clone (or open a recordset on the customer's unit
data), make each needed tab visible and set its caption to
the unit id.

All that sounds like a big mess to me and I strongly
recommend using a different mechanism to select a unit.

As an aside, do you really need all those record selectors
and navigation bars or is this just a quicky prototype?
--
Marsh
MVP [MS Access]

wow. i never thought someone would put a stopper on what access can do. i
know that it is some high ideals that i had but i didnt think access would be
incapable.

ouch.

ah, i just realized that i may have put up the wrong link for the picture i
was trying to show.

http://img170.imageshack.us/my.php?image=newformlayoutquestionsvs5.jpg

now that i am over the initial shock, i guess i will have rethink the idea
that i had and keep my ideas to a level that i know access can do.

just so i understand, to do what i was thinking isnt possible? or is it
really complicated? does access 2007 have features that would allow this?

so to do what i need i guess i would have to have a subform under the
compressor tab that pulled the information and allowed the user to use the
navigation buttons. and a subform on that that had the tabs for the dates,
part detail, etc.

my data structure has changed and now pulling the data is a little more
complicated.

is there a way to get a form that pulls from any table and puts it anywhere
i want? i want to be able to allow for additions to the tables and editing of
the records as well, not just a form that "looks" at things. my biggest
problem is the constraint of the way the data has to be in a form, subform,
fashion.
 

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