473,666 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter form by records that have subforms

I have a table called RescheduleIns and another called Shop Complete
Table that are opened together on another form called fAll Shop Orders.
On this form, all the Shop Complete Table data is displayed as the
main form and the RescheduleIns data is displayed as a subform. I
would like to open another form called fPurchasing that opens fAll Shop
Orders, but filterd based on records that have subforms. I have the
following code that loads on the fPurchasing form, but it does load
properly and I'm not sure what I'm doing wrong.

Can anyone help?

Private Sub Form_Open(Cance l As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim frmCurrentForm As Form

stDocOpen = "fAll Shop Orders"

stLinkCriteria = "Forms![fAll Shop Orders]![RescheduleIns]![Top
Level Req]=" & "'" & "[Shop Order #]= '"

DoCmd.Close

DoCmd.OpenForm stDocOpen, , , stLinkCriteria

Set frmCurrentForm = Screen.ActiveFo rm

frmCurrentForm. Label66.Caption = "PURCHASING ISSUES"
frmCurrentForm. Label66.Width = 3780
frmCurrentForm. Label66.BackSty le = 0
frmCurrentForm. Label66.ForeCol or = 0
frmCurrentForm. Caption = "fPurchasin g Issues"

End Sub

I haven't created any relationships for the two tables. Should I have
created a relationship between the two?

Thanks,

Ronnie

Jul 27 '06 #1
1 1571
I haven't created any relationships for the two tables. Should I have
created a relationship between the two?

Thanks,

Ronnie
Why not? Maybe I've been reading too many NG posts in the last few
days, but what's the point of relational databases without
relationships? (Well, unless you want to write your own code to handle
all the update/delete/orphan records violations)

Do you mean filter form for records thant have no child records? Like
a Customer that has no Invoices? (Kind of doesn't make sense, I know,
but you can do something like that in NorthWind...)

SELECT CustomerID
FROM Customer
WHERE NOT Exists (Select CustomerID FROM INVOICE)

or use an outer join... or...

Jul 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2763
by: Tony Williams | last post by:
Sorry to repost but I cannot work this out. Can anyone come up with a suggestion? I have a main form based on Table1. The form has a tab control of three pages. Each page has a subform based on a different table ie subform1 based on Table2, subform2 based on Table3 and subform3 based on Table4. I want the user to be able to use the Filter By Form facility in Access but this does not work when trying to select controls on the main form AND...
2
1602
by: sparks | last post by:
I have a table with data like this id data data data lookup 1 ### ### ### 1 1 ### ### ### 12 I need to put this in 2 subforms subfrm1 will have id=1 and lookup=1 subfrm2 will have id=1 and lookup=12
2
2840
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL record source that returns an ID field and a Text field. Next to each combo box is two buttons, one that 'Applys' the filter of the sub-form to the value in the combo box and one that 'Clears' the form's current filter. When the click event of the...
3
11960
by: dhowell | last post by:
In reading some of the posts on this group, it appears as though it is not strait forward at all to filter a form, which has subforms, by criteria which are either on subforms or span more than one subform..... This MSDN article however makes it sound as simple as clicking "Filter by Form", entering the search criterial in the form and/or it's subforms, then just clicking "Apply Filter"...... ...
9
1885
by: favor08 | last post by:
am trying to filter the 3 subforms based off of the combo boxes and textboxes. If I select one cbobox and hit submit it will filter the first but not the 2nd and 3rd then if I hit submit againthe second and third subform will filter. Sumitt is a command button that has the followin code on the onclick...
1
2843
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are setup like 'number' 'category' 'code' 'shares' and 'dollars'. Using the "backend" of this table I can filter the numbers by right clicking and using Filter For: then enter 1 or 2 or 3 and this will return results for all information that has 1 or 2 or 3 as a number. However, the problem I...
1
1737
by: richbloke | last post by:
I have a main form with two subforms each in it's own tab. Each of the subforms have a filter and On load I have "Me.FilterOn = True" set. When I load the form the filter only works on the first tab. The second tab will not filter even when I set the filter exactly the same as the first tab. Clicking on the filter button on the menu bar doesn't work either as it gives the same records whether clicked or not. Cheers
3
1946
by: sara4 | last post by:
I have a form with 2 subforms on it. The 2 subforms have a table-valued function as their recordsource and the input parameters property that 'reads' the parameter values (field values) from the main form. It all works fine when I open the form...records in my subforms are ok. If I apply the Filter By Form Access functionality on the main form and filter by a field that is used as a parameter for my subforms, the main form gets filtered...
4
5396
by: Rich P | last post by:
Maybe you could try using a query as the recordsource for your subforms and for the criteria field in the query you could use a Form parameter. This way - instead of using the form filter property you could set a value in a textbox on your mainform which would filter the query. This way all of your subforms are synchronized. fieldname: fldx Criteria: Like Forms!Form1!Text0 Text0 would be a textbox on your main form (Form1 or...
0
8454
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8363
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8787
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6203
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5672
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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

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.