473,785 Members | 2,844 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 1563

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
1898
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
3033
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
9645
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
9480
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
10330
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
10093
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
9952
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.