472,378 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Filtering Subform Records

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
3 5270
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
0
by: Jason | last post by:
I have a primary form which is used to enter/edit data in a table named Test_Results. On this primary form there is a subform which displays site addresses. This subform is linked to the primary...
1
by: MLH | last post by:
I have a form with a subform control on it listing records returned by a saved query named UnbilledVehicles. I would like to put command buttons on the main form to apply dynamic filters to the...
2
by: Katie | last post by:
I need to store a history of two fields in two seperate tables: Event - where the key is Event_ID Stage - where the key is Stage_ID The joins are: Main Table Event Table Stage Table ...
2
Scott Price
by: Scott Price | last post by:
Hello again! Running MS Access 2003 on WinXPproSP2. Now I'm trying to re-filter my subform based on the currently shown Year field (the filter applied on open restricts to 15 records relating...
8
by: Michiel Rapati-Kekkonen | last post by:
Hi, I would like that my subform is immediately filtered as soon as one types a letter in an unbound searchbox in the form. If one types an 's' the content of the subform shows only records...
4
by: OzNet | last post by:
I have a form with a subform and I need to filter the records in the subform by dates. (Access 2007) The main form has two unbound text boxes called StartFilter and EndFilter. Both use the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.