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

linking subforms by a specific value

I have a form that shows burglar alarm permits. I have a subform that
shows the alarms that have occurred at the location of the permit
(linked by permit number). There is a different fine schedule for false
alarms for burglar alarms vs. panic alarms. I thought I could just
create an alarm type field and add an additional subform so that
burglar alarms appear in the first subform, and panic alarms appear in
the second subform. I tried filtering the subforms by alarm type, but
I couldn't get the filter to save. I tried having the subforms based
on queries that separate the alarm types, but I had problems defaulting
the alarm types when adding new entries. I'm now thinking about
creating two separate alarm files, but then I'll have to update a bunch
of other stuff. What would be the best approach, and how can I get it
to work?

Nov 13 '05 #1
5 3039
You could use the Link Child Fields and Link Master Fields properties of the
subform to filter based on alarm type, and any other filter properties.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"kkrizl" <kk****@co.el-dorado.ca.us> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have a form that shows burglar alarm permits. I have a subform that
shows the alarms that have occurred at the location of the permit
(linked by permit number). There is a different fine schedule for false
alarms for burglar alarms vs. panic alarms. I thought I could just
create an alarm type field and add an additional subform so that
burglar alarms appear in the first subform, and panic alarms appear in
the second subform. I tried filtering the subforms by alarm type, but
I couldn't get the filter to save. I tried having the subforms based
on queries that separate the alarm types, but I had problems defaulting
the alarm types when adding new entries. I'm now thinking about
creating two separate alarm files, but then I'll have to update a bunch
of other stuff. What would be the best approach, and how can I get it
to work?
Nov 13 '05 #2
The Link Child Fields and Link Master Fields properties of the
subform are set to the fields that link them already (permit number in
both tables). I know I can specify additional fields by separating
them with semicolins, but what is the syntax to specify a value for the
field to be filtered by?

Nov 13 '05 #3
"kkrizl" <kk****@co.el-dorado.ca.us> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
I have a form that shows burglar alarm permits. I have a
subform that shows the alarms that have occurred at the
location of the permit (linked by permit number). There is a
different fine schedule for false alarms for burglar alarms
vs. panic alarms. I thought I could just create an alarm type
field and add an additional subform so that burglar alarms
appear in the first subform, and panic alarms appear in the
second subform. I tried filtering the subforms by alarm type,
but I couldn't get the filter to save.
Even if you had, you would have encountered the problem of what
you tried next.

I tried having the subforms based on queries that separate the alarm types, but I
had problems defaulting the alarm types when adding new
entries.
But you didn't set each subform's alarmtype.defaultvalue.
I'm now thinking about creating two separate alarm
files, but then I'll have to update a bunch of other stuff.
This would not be a smart move. both for maintenance and what if
you add a third alarm type.
What would be the best approach, and how can I get it to work?


I can suggest two options:
1) create a new table, containing alarmtype.ID and
Alarmtype.description. On the single subform, add a combobox for
the alarmtype, so that it's easy to identify and change
alarmtypeid.

2)On your mainform, add hidden textboxes, each containg the
value of one alarm type. Set the link child fields to
permitnumber;alarmtype and the link parent fields to the
permitnumber;nameoftextbox containing the alarmtype value you
want in that subform.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #4
I used option 2, and it works great.
Thanks!

Nov 13 '05 #5
LinkMasterFields and LinkChildFields must match for the Record to display in
the Form embedded in the Subform Control. Those properties _are_ a kind of
filtering. They are not as flexible as a WHERE Clause.

Larry Linson
Microsoft Access MVP

"kkrizl" <kk****@co.el-dorado.ca.us> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
The Link Child Fields and Link Master Fields properties of the
subform are set to the fields that link them already (permit number in
both tables). I know I can specify additional fields by separating
them with semicolins, but what is the syntax to specify a value for the
field to be filtered by?

Nov 13 '05 #6

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

Similar topics

11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
2
by: Mike Boozer | last post by:
I have two subforms on my main form. I want the records on subform B to correspond with the records on subform A which they do. However, I want the records on subform A to let me know if there is a...
1
by: santociabattari | last post by:
Hi Folks, I have 3 forms I want to link, so that when I advance 1 record in one form it will update the other two with the same record in the first form. I have tried using the form wizard (I...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform relates to the main form using an identity key (this works). The second subform relates to both the main and first subform. But I want to...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
3
by: Robert McEuen | last post by:
Using A2K3, Windows XP I'm handling a many-to-many relationship with a linking table structure as follows (irrelevant fields omitted): tblIssue PK_IssueID (autonumber, primary key) IssueName...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
3
by: 6afraidbecause789 | last post by:
Think school - students - discipline interventions - misbehaviors - staff for this one....On a mainform frmStudentInterventions, I have linked a subform (sfrmMisbehaviors) with another subform...
5
sickenhoofer
by: sickenhoofer | last post by:
I have a form w several subforms. The ultimate goal would be to click on a location, and have the data in the other subforms change to the data specific to that location. For this form, there are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.