473,770 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo boxes on a form

I need some help figuring this one out. I'm sure I did something like it
awhile back

but I can seemed to find that database or remember how I did this. Any way,
the

database tables are currently as follows...

tblClients tblProperties tblProjects

ProjectID
PropertyID 1----------8 PropertyID
ClientID 1----8 ClientID |-8 ClientID
Client | PropertyLocatio n | Project
|______________ ____________| ...

The form I am working on is a project worksheet. The control source a query
of the

projects table. At the top is a combo box that is to contain all of the
client names

from tblClients. Once the user selects a client, a second combo box becomes
active

for the user to select a property. cboProperties is to only contain the
properties

associated with the selected client. At this point, the user can enter all
of the

appropriate project information.

As you can see from the diagram above, there is a one-to-many relationship
between

tblClients.Clie ntID and tblProperties.C lientID; a one-to-many relationship
between

tblProperties.P ropertyID and tblProjects.Pro pertyID and I currently have a

one-to-many relationship between tblClients.Clie ntID and
tblProjects.Cli entID. I am

thinking that putting ClienID in tblProjects is redundant but I don't think
that this

is necessary creating my problems. I could be wrong, however, but I don't
want to delete it from the table just yet if it is not necessary.

How should I go about setting up this forms RecordSource so that I can
accomplish this. I have tried setting it as a query the uses the three
tables with their inherent relationships but I do not get all of the
records...

SELECT tblClients.Clie ntID, tblClients.Clie nt, tblProjects.Pro jectID,
tblProjects.Pro ject, tblClientProper ties.PropertyID ,
tblClientProper ties.PhysicalAd dress
FROM tblClientProper ties INNER JOIN (tblClients INNER JOIN tblProjects ON
tblClients.Clie ntID = tblProjects.Cli entID) ON (tblClients.Cli entID =
tblClientProper ties.ClientID) AND (tblClientPrope rties.PropertyI D =
tblProjects.Pro pertyID);

I have tried to alter the join properties on each of the joined fields but
if I change them I get an error telling me that I have ambiguous outer
joins.
Apr 15 '07 #1
1 1677
okay, so one client may have many properties, and each property belongs to
one client. one property may have many projects, and each project belongs to
only one property. correct so far?

if so, then you're correct in that you should not have a ClientID foreign
key field in tblProjects. since each project belongs to a specific property,
and each property belongs to a specific client, each project is already
*indirectly but clearly* linked to a specific client.

to set up a data entry form to add/edit projects for existing properties,
you don't need to link any of the tables in a query, and you only need one
small line of code in a form. suggest the following:

an unbound main form; i'll call it frmMain. add an unbound combobox control,
with tblClients (or a query based on tblClients) as its' RowSource; i'll
call the control cboClients. make sure that the BoundColumn is the ClientID
field (if you're not familiar with combo box controls, read up on them in
Access Help). add a second unbound combobox, with a query based on
tblProperties as its' RowSource; i'll call it cboProperties. add criteria to
the ClientID field in the query, as

Forms!frmMain!c boClients

make sure the BoundColumn is PropertyID. add code to cboClient's AfterUpdate
event procedure, as

Me!cboPropertie s.Requery

now when you choose a client from cboClients, the properties list in
cboProperties is automatically filtered to match that client.

create a second form, bound to tblProjects; i'll call it frmProjects. in
frmMain Design view, add a subform control (from the Toolbox toolbar); i'll
call it ChildProjects. set the subform control's properties as

SourceObject: frmProjects
LinkChildFields : PropertyID
LinkMasterField s: cboProperties

now when you choose a property from cboProperties, the subform will be
automatically populated with only the project records for that property.

hth
"Kevin" <no**@email.com wrote in message
news:tL******** *************@f e05.news.easyne ws.com...
I need some help figuring this one out. I'm sure I did something like it
awhile back

but I can seemed to find that database or remember how I did this. Any
way,
the

database tables are currently as follows...

tblClients tblProperties tblProjects

ProjectID
PropertyID 1----------8 PropertyID
ClientID 1----8 ClientID |-8 ClientID
Client | PropertyLocatio n | Project
|______________ ____________| ...

The form I am working on is a project worksheet. The control source a
query
of the

projects table. At the top is a combo box that is to contain all of the
client names

from tblClients. Once the user selects a client, a second combo box
becomes
active

for the user to select a property. cboProperties is to only contain the
properties

associated with the selected client. At this point, the user can enter all
of the

appropriate project information.

As you can see from the diagram above, there is a one-to-many relationship
between

tblClients.Clie ntID and tblProperties.C lientID; a one-to-many relationship
between

tblProperties.P ropertyID and tblProjects.Pro pertyID and I currently have a

one-to-many relationship between tblClients.Clie ntID and
tblProjects.Cli entID. I am

thinking that putting ClienID in tblProjects is redundant but I don't
think
that this

is necessary creating my problems. I could be wrong, however, but I don't
want to delete it from the table just yet if it is not necessary.

How should I go about setting up this forms RecordSource so that I can
accomplish this. I have tried setting it as a query the uses the three
tables with their inherent relationships but I do not get all of the
records...

SELECT tblClients.Clie ntID, tblClients.Clie nt, tblProjects.Pro jectID,
tblProjects.Pro ject, tblClientProper ties.PropertyID ,
tblClientProper ties.PhysicalAd dress
FROM tblClientProper ties INNER JOIN (tblClients INNER JOIN tblProjects ON
tblClients.Clie ntID = tblProjects.Cli entID) ON (tblClients.Cli entID =
tblClientProper ties.ClientID) AND (tblClientPrope rties.PropertyI D =
tblProjects.Pro pertyID);

I have tried to alter the join properties on each of the joined fields but
if I change them I get an error telling me that I have ambiguous outer
joins.


Apr 15 '07 #2

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

Similar topics

1
3321
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in about 3 years and I'm more rusty than I thought I was. Anyway, in a nutshell: The scenario: 2 combo boxes (comboLastName and comboStateorProvince) on a form with 30 text boxes, the form's recordsource has been set to a query, both combo boxes and...
0
3537
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the form, I set the rowsources of its, and its subforms', combo boxes in the "Enter" events of the combo boxes. That's the standard trick for not loading the rowsource unless/until the user actually needs the combo box. For example:
1
2714
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms relate addresses (multiple addresses); companies, contacts, and tasks to each project (one to many). My challenge lies with the task sub-form which links to the Project form through ProjID. The task record links back to the respective master...
2
5472
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would like to eventually be able to filter down through the tables untill i can reach one unique record. I am creating a datbase to keep track of registered accounts for a stae program. Each account is registered into the program through a two...
5
3702
by: jjyconsulting | last post by:
Newbie needing some help. I have a tblParticipants. The fields include gender, education_level, income, occupation etc., I'm trying to create a form where a user can run a query from the form and just choose the appropriate criterias from the combo boxes to get the results. I also want the query to run even if there is not a value in all the combo boxes ie., i want just all males with income level of over $100,000...Any insights or help...
4
64638
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
6
3682
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
2908
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc) and a subdatasheet (the subform...let's call it subInfo) below the combo boxes on the RD Form. I hope this eliminates any confusion of the
2
3268
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once selecting from the combo box, I have all the combo boxes, using afterupdate, populating their respective list boxes. These text boxes are directly correlated to the combo box selection using SQL. Here is an example from the afterupdate event in the...
0
9618
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
9454
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
10259
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
10038
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
9906
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
6710
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
5354
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...
1
4007
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
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.