473,796 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to link a form with a subform

Hi,

I've inherited an Access database and need to create a form which will
allow me to view and alter the data. I've created a new form and using
a tip I got from this helpful site http://www.jmhare.com/wildhare2.htm
, I've created two combo boxes, with the contents of the second combo
box depending upon the value in the first. That's working fine though
it took a while to get it working properly because I don't think the
database is too correct or efficient (lookups everywhere). I want to
create a subform on that form where one of the fields in the records
is the same value as the second combo box.

Here's the SQL I have so far:

QryCountryCodes ByClub
---------------------
SELECT Countries.[CTRY CODE]
FROM Countries INNER JOIN Clubs ON Countries.[CTRY ID] =
Clubs.[CLUBS-COUNTRY_Code]
ORDER BY Countries.[CTRY CODE];

QryCountryCodes ByClub (combo box 1)
-----------------------------------
SELECT DISTINCT QryCountryCodes ByClub.[CTRY CODE]
FROM QryCountryCodes ByClub
ORDER BY QryCountryCodes ByClub.[CTRY CODE];

QryClubShortnam esFromCombo1 (combo box 2)
----------------------------------------
SELECT Clubs.CLUBS_Sho rtname
FROM Countries INNER JOIN Clubs ON Countries.[CTRY ID] =
Clubs.[CLUBS-COUNTRY_Code]
WHERE (((Countries.[CTRY CODE])=[forms]![frmMain]![COMBO1]))
ORDER BY Clubs.CLUBS_Sho rtname;

The relevant tables are called Personnel, Clubs and Countries. The
Personnel table is basically football players' details, including a
field called PLAYERS-CLUBS_Shortname which is a lookup to the field in
Clubs called CLUBS_Shortname . The Countries table has a three letter
code (CTRY CODE) and the Clubs table has a field (CLUBS-COUNTRY_CODE)
which is a lookup to the CTRY ID identifier in the Countries table. I
want the subform to only show those records where
Personnel.PLAYE RS-CLUBS_Shortname = the value in the second combo box
which itself depends upon the value in the first combo box. I hope
there's enough information there. I'd be grateful for any help at all,
been trying to get this to work for a day now.

Cheers

Mark
Nov 12 '05 #1
0 1565

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

Similar topics

2
21056
by: Deborah V. Gardner | last post by:
I am using Access 97 and have had a problem joining a main form and a subform. I have a main form and a subform. The data source on the main form is a SELECT statement referring to three tables. The subform's data source is a table. When I try to link the Child and Master fields, I get the message "Can't build a link between unbound forms." I have tried typing in the common fields and it still does not work.
12
3505
by: turtle | last post by:
I am creating a database that tracks the Techinical Skills of our engineers. There are about about 200 techinical skills that they will need to fill out by giving themselves a ranking. Some fields they will not fill out and others they will. Here is an example: Employee # 1 Languages Skill Experience (yrs) C++ 3 4 VB 2 2
0
275
by: Mark Gifford | last post by:
Hi, I've inherited an Access database and need to create a form which will allow me to view and alter the data. I've created a new form and using a tip I got from this helpful site http://www.jmhare.com/wildhare2.htm , I've created two combo boxes, with the contents of the second combo box depending upon the value in the first. That's working fine though it took a while to get it working properly because I don't think the database is...
3
8480
by: Mark C | last post by:
I have a unbound form with a tab control with four tabs in an Access 97 database. On each tab I have a sub form each form on the sub forms is bound to its own table. Each table has a field that can link them all together. I have put an invisible unbound control on the master form that gets populated on open. I set the link child and link master of each sub form to the unbound control on the master form. When the form opens all the subforms...
0
2120
by: Ace Calhoon | last post by:
Hello, Using Access 2003 SP-1. I have a form which contains a subform. Each form represents a table, and is linked by two fields. These fields are also related in the underlying tables, with referential integrity and cascading updates enabled. The problem occurs when I attempt to update one of the link fields in the parent form. Instead of displaying the cascaded updates (i.e. not
6
1900
by: Gary T. | last post by:
I have 3 tables: tbl_customer -CustID -fkeyMarketingID -CompName -CompAddr -ContactName -ContactAddr -Ph
4
2200
by: MLH | last post by:
I have a subform control on a mainform. Each time I do anything experimentally with it - like even change its Width property, A97 takes the liberty of setting values in the link child field and link master field to a common field value. This is happening, I suppose, because I have purposefully left the two property settings empty. I'm just using the unbound subform control as a glorified list box. Can I prevent this undesirable...
0
1124
by: sparks | last post by:
I went into relationships and set the link between the 2 tables and its 1 to many everything ok. I take a subform and add it as a subform onto form1 the wizard asks about link child and master and its ID3 fine. but when you add a record into the parent form no id shows up in ID3 of the subform. when you select the subform and click on link master or child it says ERROR
12
3034
by: banderson | last post by:
Hello all, I am hoping that you can help me with a problem that has occurred numerous times on various forms in the two databases that I am working on. When I first add a subform to a form linking child and master fields (primary key and foreign key), the subform will automatically update when the master field on the main form is changed (it is in a combo box). However, when I work more on the form - making it a bit more complicated, adding...
0
9679
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
10453
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...
1
10172
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,...
1
7546
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
6785
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
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
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
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
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.