E
Evi
Have a look down this list Giraffe and see if they are all true
Your main form needs to be based on TblAgreement. (or a query based only on
that table)
Your Subform needs to be based on TblAgreementWith (or its query) and
linked by AgreementId
Add all the fields from TblAgreementWith for now to this subform, you can
always Hide unwanted columns using the Format menu.
Your combo needs to be based on TblOrg (or its query) and should have from
TblOrg, OrgID, Other fields from TblOrg. In Properties on the Data tab, its
ControlSource should be OrgID.
Next to Bound Column, it should say 1.
Evi
Your main form needs to be based on TblAgreement. (or a query based only on
that table)
Your Subform needs to be based on TblAgreementWith (or its query) and
linked by AgreementId
Add all the fields from TblAgreementWith for now to this subform, you can
always Hide unwanted columns using the Format menu.
Your combo needs to be based on TblOrg (or its query) and should have from
TblOrg, OrgID, Other fields from TblOrg. In Properties on the Data tab, its
ControlSource should be OrgID.
Next to Bound Column, it should say 1.
Evi
GIraffe said:Hi Evi:
Thank you. I've very excited that this may actually work. So I go in to my
form to add this new subform and for each existing record the right agreement
# shows up with the right organization (Yes!). Then I go to add a new
record, and I am unable to choose an organization in my new subform. My
column headings show up (agreementno and organization), however, no drop down
options for either column, so I am unable to choose the organization that
goes with my new agreement.
I checked the properties and the Master and Child Links are okay
(AgreementID). What else should I check?
Thanks Evi, I couldn't have made it this far without you.
G
Evi said:Hi G, That sounds really good.
Evi
don'tGIraffe said:Hi Evi:
Boy, to have you looking over my shoulder would sure have made this sooo
much easier to solve. Sorry for the long thread ....
Okay, here's what I have:
My tables are setup exactly as you describe, with the exception of in my
TblAgreementWith I also have an AgreementWithID as PK; however, I
THINKIthat'll make a difference .... right?
I THINK I created the datasheet form correctly. Here's what I have:
Data based on TblAgreementWith
AgreementWithID
AgreementID
OrgID
Combobox: TblAgreement.AgreementID (2nd field chosen AgreementNo)
Combobox: TblOrg.OrgID (2nd field, OrgLine1; 3rd field, OrgLine2; 4th
field, POC)
In View mode of this datasheet I have
AgreementWithID, AgreementID, OrgID, AgreementNo, OrgLine 1 (if I can get
this fixed, I will be combining several fields in one for my Orgs)
If I go to either AgreementNo or OrgLine1, I get a dropdown option and
cangettingactually change either one on a record.
And, guess what Evi? ALL my Org show up ... even the tests I setup as we've
been working through this. This is a FIRST. I'm very excited.
Please tell me I have it right so far.
G
:
I have this horrible feeling that we are both misunderstanding something. Oh
for a crystal ball so I could see what is happening!
Let's check that we've got the structure right. (the thread is
longsortand my brain is short!)
TblAgreement should contain each Agreement only once PK AgreementID
TblOrg should have each org only once - PK OrgID
TblAgreement With should have the foreign key fields AgreementID and OrgID
The structure of your Form should be like this (basically)
Give this a try and you'll see what I mean.
Create a datasheet form based on the AgreementWith table. Don't add fields
from the other tables just yet until you get a real feel for this
of(orstructure.
Add a combo to it in Design View. It should be based on TblAgreement
onfroma query that is based directly on that table - don't add fields from the
other tables for now)
It's first field should be AgreementID, pull the column closed in the
Wizard, its next field (the one which you will actually see in the combo)
can be any comination of fields in TblAgreement which will help you to
identify that Agreement. When you get to the relevant page in the Wizard,
agree to store the value in AgreementID
Similarly, add a combo based on TblOrg or a query based only on that table-
again make the first field OrgID, hide it and then add the OrgName
use the combos to fill in the 2 Foreign Key fields in TblAgreementWith.
Is this bit working, G?
Evi
Hi Evi:
I'm obviously missing something. First, I chose not to concatenate my
fields, I wanted to see if I could get the principle of this to work
first.
I created the query [qOrg] putting 2 tables in the query [tOrg] &
[tOrgWith], figuring I needed the tOrgWith table because it's a
conjunction
table for tAgreements & tOrg, even tho I didn't use any fields
it.itFrom
tOrg I chose OrgID, Org, POC.
I made my combo box in my fAgreements, not as a subform, but as a combo
box.
I chose to use my above query, chose my 3 fields, related them by OrgID,
chose to remember the value for a later use, went in to the Column Widths
of
the Properties box and made my first column (my OrgID) 0". So now only my
Org shows up (don't know why POC's not showing up). However, the Org
that's
showing up is not the correct Org for the Agreement (on none of the
agreements). Do I need to rechoose each Org for each agreement?
Secondly,
just to test this, I went in to my Org table and added a new Org, when
back
to my form and it does not show up . And lastly, some agreements have
more
then one Org, how can I do this in the combo box?
What am I missing?
Thanks for your help Evi.
G
:
You 're using the wrong OrgID for your combo. You need the OrgID from
TblOrg
in your combo - not the OrgID from TblAgreementWith.
Don't use any fields from TblAgreementWith if you are trying to put
OrgID
into TblAgreementWith using your combo. That's like trying to scratch
your
left elbow with your left elbow!
If OrgID - your Primary Field key -is Unique (as it must be, if
is aitPrimary Key) then having each OrgName mentioned twice can be overcome
until
you have time to redesign your db. All you need you need to do is to
create
a query for your combo.
If your Org Table has OrgID, OrgName and POC then add OrgID to your
query
first.
In the next column type
OrgFOC: [Org] &" " & [POC]
You can concatenate as many fields as you need here to give each record
a
unique name in your combo. A handy tip I learnt on the Report newsgroup
is
to link your fields using
Trim(([Org] + " ") & ([POC] + " ") & ([AnotherField]))
If any of the fields are null then + inside the () means that
won'tfieldshow
anything, including the space.
Use the Trim to get rid of a final space if POC has a value but
AnotherField
doesn't.
When you make the combo, add OrgID and then your concatenated
butthatclose the OrgID column by dragging it closed in the Wizard so
it(OrgID)won't
show in your combo.
Will this help?
If your Org table does not have a Unique Primary Key field
thenKeyAccess can't possibly know which of the two OrgIDs to link to your
AgreementWith table.
It can be rectified but I won't start on that (long) process until I
know it
is needed.
I've had to do it a quite a few times, when I got a design wrong
Evi
Hi Evi:
I don't think you're missing anything important ... I think I've
missed
something pretty critical somewhere.
My combo box is based on the Org Table & OrgID is the Foreign
totoOrg
ID
in the Agree Table. After reading your reply, I'm beginning
thinkbeenI
have
a bigger problem then I started this inquiry with (argh!).
Evi, thanks to your help, I can see that my original design of this DB
was
flawed, and I can't thank you enough for helping me. You've
verywith megracious with your time and advice -- I hope will you bear
athingslittle
more.
For starters, part of the multiple listings in Org Table is me ....
when I
originally created this DB 4 years ago, I didn't realize
wouldDBs Iblossom
in to what this has become (nor did I have the knowledge on
havenewtoday). So, for my Org Table, if I had the same Org, however, a
different
field office or point-of-contact, I listed the Org twice, with
newlink anfield
office or POC. That's PART of the problem. I know how to
Orgthentable
to an OrgAdd table, however, for this situation, won't that require a
combo
box within a combo box -- can you do that?
The other part of the problem, the same Org if it has more
onequeryagreement, I do not know. So I'd like to start with what my
forOrgWiththe
combo box looks like:
tOrgWith (this is my conjuction table between Org and Agree)
OrgWithID [PK]
AgreeID
OrgID
tOrg
OrgID [PK] [FK to tOrgWith.OrgWithID]
OrgLine1
OrgLine2
I use
tOrg.Org ASC (with an IIf statement joining OrgLine1 & OrgLine2)
tOrg.POC
tOrgWith.OrgWithID
tOrgWith.AgreeID
tOrgWith.OrgID
For this query, if I do not use the the 3 fields in the
Table,nothing will show up in my combo box.
Secondly, my combo box is built in to a separate subform from the
Agree
Table. The subform contains:
tOrgWith.OrgWithID
tOrgWith.AgreeID
tOrgWith.OrgID
OrgWith combo [based off of above query]
I added the combo box to get my Org name to show up, because I
wouldn't
know
what ID # which Org was.
So that's the intricacies of how all this works (or doesn't work).
Once gain, Evi, I thank you for all your help.