473,385 Members | 1,817 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,385 software developers and data experts.

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 1593
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.com
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.com 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.com
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
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...
3
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...
1
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...
2
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...
0
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...
3
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...
1
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.