473,509 Members | 2,951 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(Cancel 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.ActiveForm

frmCurrentForm.Label66.Caption = "PURCHASING ISSUES"
frmCurrentForm.Label66.Width = 3780
frmCurrentForm.Label66.BackStyle = 0
frmCurrentForm.Label66.ForeColor = 0
frmCurrentForm.Caption = "fPurchasing 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 1559
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
2749
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...
2
1590
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...
2
2821
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...
3
11938
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...
9
1871
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...
1
2836
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...
1
1729
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....
3
1930
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...
4
5369
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...
0
7237
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,...
0
7137
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...
1
7073
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...
0
5656
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,...
1
5062
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...
0
3218
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...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
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 ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.