By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

Filtering Subform Records

P: n/a
On my Main form I have a Command Button that opens a Subform in order
to create a new Subform record.

At this point I want the subform to show only the new record being
created.
Not all the records the subform's table has.

I cannot put the subform as Data Entry because I cannot print the main
form & subform together if the subform is "data entry". (comes up
blank every time)

What code do I use to filter all subform records except for the
current?

Or what code do I use to print out the current Main Form, & individual
Subform record.

(acSelection) does not work, it prints out all subform records.

I dont want to make reports, I want to print the form itself exactly
how it is

Apr 3 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
pa****@gmail.com wrote:
On my Main form I have a Command Button that opens a Subform in order
to create a new Subform record.
If the button "opens" the other form then it is not a subform. A subform is
one form embedded inside of another. If you open the form separately then
it is just a standard form and it will not inherit the foreign key values
from your other form as it would if it were a true subform.
At this point I want the subform to show only the new record being
created.
Not all the records the subform's table has.

I cannot put the subform as Data Entry because I cannot print the main
form & subform together if the subform is "data entry". (comes up
blank every time)
Forms suck at printing. Make a report instead. Besides if you save the
record on the subform before printing then it won't be blank any longer.
What code do I use to filter all subform records except for the
current?
If you are adding a record then you have no "current" record to filter on.
Or what code do I use to print out the current Main Form, & individual
Subform record.
As stated, don't print forms.
(acSelection) does not work, it prints out all subform records.

I dont want to make reports, I want to print the form itself exactly
how it is
You can make a report that looks just like the form except that it will work
proerly for printing. As a head start you can right-click the form in the
dbWindow and choose "save as report".

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Apr 3 '07 #2

P: n/a
Yes I can save the form as a report and looks just lovely, although it
still doesnt filter the records.
....So the user would have to make the record in a form, open a report
based on a form based on a query to get the specific records for
printing.

Sorry I didnt mean to say "opens" the subform. Makes the subform
visible in an 'Allow additions' state. Then the record's PK Value
(Autonumber) becomes assigned as well, which leads me to believe it is
a valid record that a filter could be based on.

Please advise as to why I keep hearing "print reports, not forms"
I have these form set up fine on my monitor, I print them and there is
no problems. They look fine.
My main problem is filtering the records that I want printed.
(Which doesnt seem to be covered in the reports section as well), I
cant even select the subform when in the "Report version" of the
form...

Apr 5 '07 #3

P: n/a
pa****@gmail.com wrote:
Please advise as to why I keep hearing "print reports, not forms"
I have these form set up fine on my monitor, I print them and there is
no problems. They look fine.
I suppose because printing something that "looks just like what I see on the
screen" is seldom a requirement. Reports can group data whereas forms
cannot. Reports have lots of events that fire during printing that can be
used to do all sorts of things. Forms do not.

Basic printing of forms is supported much in the same way that printing
datasheets for queries and tables is supported. The fact that the option is
there doesn't mean that it is a good idea.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.