473,663 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filtering Between Subforms

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 [Account Number]
Event Table [Account Number] [Event_ID]
Stage Table [Event_ID] [Stage_ID]

My screen has:
An unbound main form which draws account number from the previous
screen
A continuous form Event subform linked to the main form by Account
Number
A continuous form Stage subform

My problem is this:
I can link and filter the Main form to the Event subform as there will
only be one event for each account
I need to filter the Stages subform by the Event_ID, which I can do in
the query behind the form, but if there are no stages the query filters
to nothing and I can't add a new record.

I have tried filtering in VBA on change of one of the fields on the
Event form, but to no avail.

In my head I can see this is such a simple problem, but I have tried to
sort it for three days now and I have a deadline looming.

Help!

Dec 1 '06 #1
2 1606
Try using a nested subform (no code necessary):

Create 3 forms - one for each table (no queries needed): FormA, FormB, FormC
Each form should work as expected (allow edits, additions, etc.).
Embed FormC into FormB and use [Event_ID] as the linking field.
This should work as expected (move to record in FormB and the corresponding
records in FormC should appear, edits and additions should work...).
Now embed this combined form into FormA and use [Account Number] as the
linking field.

Katie wrote:
>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 [Account Number]
Event Table [Account Number] [Event_ID]
Stage Table [Event_ID] [Stage_ID]

My screen has:
An unbound main form which draws account number from the previous
screen
A continuous form Event subform linked to the main form by Account
Number
A continuous form Stage subform

My problem is this:
I can link and filter the Main form to the Event subform as there will
only be one event for each account
I need to filter the Stages subform by the Event_ID, which I can do in
the query behind the form, but if there are no stages the query filters
to nothing and I can't add a new record.

I have tried filtering in VBA on change of one of the fields on the
Event form, but to no avail.

In my head I can see this is such a simple problem, but I have tried to
sort it for three days now and I have a deadline looming.

Help!
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 1 '06 #2
Thank you so much! I honestly don't know what I would do without these
groups!!

kingston via AccessMonster.c om wrote:
Try using a nested subform (no code necessary):

Create 3 forms - one for each table (no queries needed): FormA, FormB, FormC
Each form should work as expected (allow edits, additions, etc.).
Embed FormC into FormB and use [Event_ID] as the linking field.
This should work as expected (move to record in FormB and the corresponding
records in FormC should appear, edits and additions should work...).
Now embed this combined form into FormA and use [Account Number] as the
linking field.

Katie wrote:
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 [Account Number]
Event Table [Account Number] [Event_ID]
Stage Table [Event_ID] [Stage_ID]

My screen has:
An unbound main form which draws account number from the previous
screen
A continuous form Event subform linked to the main form by Account
Number
A continuous form Stage subform

My problem is this:
I can link and filter the Main form to the Event subform as there will
only be one event for each account
I need to filter the Stages subform by the Event_ID, which I can do in
the query behind the form, but if there are no stages the query filters
to nothing and I can't add a new record.

I have tried filtering in VBA on change of one of the fields on the
Event form, but to no avail.

In my head I can see this is such a simple problem, but I have tried to
sort it for three days now and I have a deadline looming.

Help!

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1
Dec 5 '06 #3

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

Similar topics

3
11097
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 related to the TestResults table (and the primary form) named Names-Normalized and SiteAddresses. The...
5
3075
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 something illegal in my code? It used to work but I have added conditional formatting to a subform...
3
3881
by: dixie | last post by:
I have a form full of subforms which bring summary information onto the form from about 12 different tables. I am trying to get all of that summary information (mainly numbers) into 1 large table that represents the final results for the year. The table into which I wish to save it has 10 records, the past 10 years results. The problem is that I select the calendar year from an unbound combo box and it runs a filter that restricts the...
1
2986
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
2
2995
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
2239
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
3
2607
by: Todd | last post by:
Hi, I've been told in another forum that I can apply a filter to a subform (from a control on the main form) by using the following code: Me.sfrMySubform.Filter = " = 7" I've tried this solution but it isn't working for me. Here's my code: Private Sub fraShowRows_Click()
1
1607
by: crazytegger | last post by:
I am trying to filter a subforms combolist options through a combolist on the main form. Heres what i have: Form: frmOrderDetail Datasource: tblOrders cmbOrderSupplierID w/ control source orders. Subform: frmOrderDetailSubform datasource: qryOrderDetails cmbItemID w/ row source: SELECT ., .
2
59139
NeoPa
by: NeoPa | last post by:
CHAPTER 1 - TABLE OF CONTENTS (Including attached database) CHAPTER 2 - INTRODUCTION CHAPTER 3 - TABLE LAYOUT CHAPTER 4 - FORM LAYOUT CHAPTER 5 - FORM MODULE CHAPTER 6 - CODE DISCUSSION (FILTER CONTROLS) CHAPTER 7 - CODE DISCUSSION (THE REST) --------------------------------------------------------------------------------
0
8436
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
8345
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
8858
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
8771
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...
1
8548
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
4182
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
2
1757
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.