473,549 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5373
pa****@gmail.co m 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.co m 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
11090
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 have a primary form named TestResults, which is connected to data in a table named TestResults. There are basically two other tables that are...
5
3069
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 I want to send the error report to Microsoft. Has anybody seen this type of error message and what can I do to prevent it from happening. Am I doing...
19
3516
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 form, the subform returns the records based on the two criteria. The criteria used on the main form are values selected in two list boxes. When the...
0
2010
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 form by field named TestID. The subform is used just for displaying site address data, data which is stored in another table named...
1
2279
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 records displayed in the subform control. Say, for instance, to list only 2004 model cars. I'm seeking the simplest approach. The main form is...
2
1603
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 My screen has:
2
2160
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 to the year 1990). I've added a command button to call the code designed to re-filter to the 13 or so records according to the next year (1991 in this...
8
1279
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 starting with s If one continues with 'e' the subform would show the ones starting with se. If one would correct that to 'e' by going back and removing...
4
1653
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 Datepicker feature. Both have the Now() function as the Default setting to limit records to today's date as the default setting. Both are set to the short...
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5377
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.