473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 5359
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.