Subform launched from Continous Form

  • Thread starter annie via AccessMonster.com
  • Start date
A

annie via AccessMonster.com

Hi,

I've been searching around the forum, and I'm at loss on how to do this -

I have a continuous form that displays project information (Project name,
client, project number, etc.).

I want to have a command button that launches a subform where I can enter
multiple people related to the job (sales rep, manager, etc.). I have it set-

up now where I can launch the subform and it is filtered on the specific job
to show all of these people, but I cannot figure out how set-up to
allow me to enter new information on both the continous form AND the sub-form
that is opened via the command button.

I also need to have a second command button that launches a subform to enter
errors related to the job (need to be able to enter multiple errors per one
job). So, that's why I chose to go with the command button versus having two
continuous forms on an unbound main form.

Any help would be MUCH appreciated... I'm stumped!

Thanks!
 
R

Rob Parker

Hi Annie,

This is not a solution, but some general comments that might help you decide
which way to go.

First (and vitally important), I think you are misunderstanding what a
subform is. It is a form embedded in the main form which shows related
(generally one-to-many, as in your situation) records. A subform is not
"launched" as a separate form via a command button; any form opened in that
manner is a form in its own right - it is not a subform. It can, as you
have discovered, be set up to display a recordset filtered by field(s) in
the current record on another form.

If you use separate forms, you will need to include code to set the primary
key field(s) for any new records added to the subsiduary forms, and to cope
with changing the current record on the main form. It is do-able, and not
particularly difficult, but you do need to be comfortable with coding,
understand what events on each form will need to cause changes in the other
forms, and code for all eventualities.

On the other hand, subforms are designed for exactly this situation; the
master/child links take care of all this stuff. BUT, subforms cannot be
used in a continuous form (although subforms themselves can be continuous
forms). I strongly suggest that you change your main form to display a
single record only, and use either the built-in navigation buttons or add
your own (there's lots of examples of code for that available - one example
is at Roger's Access Library
http://www.rogersaccesslibrary.com/download3.asp?SampleName=RecordNavigation.mdb)
to deal with moving between different projects. Then add real subforms (you
can have multiple subforms on a form) to the main form. You could use a tab
control to place the subforms on separate "pages" on your main form - that's
a commonly used technique which gives a nice user interface and prevents the
main form becoming too crowded.

HTH,

Rob
 
A

annie via AccessMonster.com

Hi Rob,

Thanks for your response and insight.

I mis-worded the 'sub-form' - I have built a seperate form that I would like
to launch (command button opening the seperate form) from another form, but
again, I haven't been able to get all of the coding right to be able to link
the two up seamlessly. I have a pretty good idea of what I need to do with
the events, queries, etc. to get them there, but just haven't had success in
making it all happen!

All my other forms that I'm using in the database are single record forms,
but I really need the ability to be able to look at many different
records/projects on this form - the person who will be using it runs many
projects at the same time, so he needs to be able to look at multiple jobs
and bounce back and forth entering information for all of them. So, although
I'd really like to go with your suggestion, but I think it'd be fairly
difficult for the user to do his job and enter the information in an easy
manner.

Thanks for your help!

Rob said:
Hi Annie,

This is not a solution, but some general comments that might help you decide
which way to go.

First (and vitally important), I think you are misunderstanding what a
subform is. It is a form embedded in the main form which shows related
(generally one-to-many, as in your situation) records. A subform is not
"launched" as a separate form via a command button; any form opened in that
manner is a form in its own right - it is not a subform. It can, as you
have discovered, be set up to display a recordset filtered by field(s) in
the current record on another form.

If you use separate forms, you will need to include code to set the primary
key field(s) for any new records added to the subsiduary forms, and to cope
with changing the current record on the main form. It is do-able, and not
particularly difficult, but you do need to be comfortable with coding,
understand what events on each form will need to cause changes in the other
forms, and code for all eventualities.

On the other hand, subforms are designed for exactly this situation; the
master/child links take care of all this stuff. BUT, subforms cannot be
used in a continuous form (although subforms themselves can be continuous
forms). I strongly suggest that you change your main form to display a
single record only, and use either the built-in navigation buttons or add
your own (there's lots of examples of code for that available - one example
is at Roger's Access Library
http://www.rogersaccesslibrary.com/download3.asp?SampleName=RecordNavigation.mdb)
to deal with moving between different projects. Then add real subforms (you
can have multiple subforms on a form) to the main form. You could use a tab
control to place the subforms on separate "pages" on your main form - that's
a commonly used technique which gives a nice user interface and prevents the
main form becoming too crowded.

HTH,

Rob
[quoted text clipped - 25 lines]
 
R

Rob Parker

Annie,

A couple of quick thoughts that might be of use:

1. Change your main form to a single form (as previously suggested), and
include a combo-box in the header to allow quick selection of the particular
job/project to be displayed in the form. That might be sufficient to allow
easy browsing between projects.

2. From your continuous mainform, use a command button (you could have one
on each row, labelled "Details") to open a separate form which displays the
selected record in a single record form. Add real subforms to that form.

HTH,

Rob

annie via AccessMonster.com said:
Hi Rob,

Thanks for your response and insight.

I mis-worded the 'sub-form' - I have built a seperate form that I would
like
to launch (command button opening the seperate form) from another form,
but
again, I haven't been able to get all of the coding right to be able to
link
the two up seamlessly. I have a pretty good idea of what I need to do
with
the events, queries, etc. to get them there, but just haven't had success
in
making it all happen!

All my other forms that I'm using in the database are single record forms,
but I really need the ability to be able to look at many different
records/projects on this form - the person who will be using it runs many
projects at the same time, so he needs to be able to look at multiple jobs
and bounce back and forth entering information for all of them. So,
although
I'd really like to go with your suggestion, but I think it'd be fairly
difficult for the user to do his job and enter the information in an easy
manner.

Thanks for your help!

Rob said:
Hi Annie,

This is not a solution, but some general comments that might help you
decide
which way to go.

First (and vitally important), I think you are misunderstanding what a
subform is. It is a form embedded in the main form which shows related
(generally one-to-many, as in your situation) records. A subform is not
"launched" as a separate form via a command button; any form opened in
that
manner is a form in its own right - it is not a subform. It can, as you
have discovered, be set up to display a recordset filtered by field(s) in
the current record on another form.

If you use separate forms, you will need to include code to set the
primary
key field(s) for any new records added to the subsiduary forms, and to
cope
with changing the current record on the main form. It is do-able, and not
particularly difficult, but you do need to be comfortable with coding,
understand what events on each form will need to cause changes in the
other
forms, and code for all eventualities.

On the other hand, subforms are designed for exactly this situation; the
master/child links take care of all this stuff. BUT, subforms cannot be
used in a continuous form (although subforms themselves can be continuous
forms). I strongly suggest that you change your main form to display a
single record only, and use either the built-in navigation buttons or add
your own (there's lots of examples of code for that available - one
example
is at Roger's Access Library
http://www.rogersaccesslibrary.com/download3.asp?SampleName=RecordNavigation.mdb)
to deal with moving between different projects. Then add real subforms
(you
can have multiple subforms on a form) to the main form. You could use a
tab
control to place the subforms on separate "pages" on your main form -
that's
a commonly used technique which gives a nice user interface and prevents
the
main form becoming too crowded.

HTH,

Rob
[quoted text clipped - 25 lines]
 
A

annie via AccessMonster.com

Thanks much - I didn't even think about using a sub-form within the main form
that would open with the command button - that should work perfectly. I'm
going to give that a whirl, and will run the combo box idea past the user.

Thanks again!

Rob said:
Annie,

A couple of quick thoughts that might be of use:

1. Change your main form to a single form (as previously suggested), and
include a combo-box in the header to allow quick selection of the particular
job/project to be displayed in the form. That might be sufficient to allow
easy browsing between projects.

2. From your continuous mainform, use a command button (you could have one
on each row, labelled "Details") to open a separate form which displays the
selected record in a single record form. Add real subforms to that form.

HTH,

Rob
[quoted text clipped - 77 lines]
 

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