I think you misunderstood my question. I asked what the primary key field is
in the "t_CheckREQ" table. You gave me the primary key field for the other
table. You must have the primary key field from the "t_CheckREQ" table in
the query -- this would be t_CheckREQ.ICNSR , correct?
Add the t_CheckREQ.ICNSR field to the query's list of fields in the SELECT
clause.
And, quite honestly, I'm not sure why you need to join the two tables for
your form's desired operation. Instead, what I'd suggest is that you use a
form/subform setup -- have the main form's RecordSource query be this:
SELECT t_DataTracking.ICNSR FROM t_DataTracking ORDER BY
t_DataTracking.ICNSR;
Then have the subform use this query as its RecordSource:
SELECT t_DataTracking.ICNSR, t_CheckREQ.ChkREQ, t_CheckREQ.BCBSF,
t_CheckREQ.FCSO, t_CheckREQ.INCP, t_CheckREQ.FCL, t_CheckREQ.COI,
t_CheckREQ.FCIA, t_CheckREQ.NAVIGY, t_CheckREQ.BusinessUnit,
t_CheckREQ.Date,
t_CheckREQ.CHGmonetery, t_CheckREQ.CHGacct, t_CheckREQ.CHGcc,
t_CheckREQ.CHGrecipient, t_CheckREQ.CHGaffillate, t_CheckREQ.CHGproduct,
t_CheckREQ.CHGmanacct, t_CheckREQ.CHGmanhour, t_CheckREQ.Total,
t_CheckREQ.Details, t_CheckREQ.SpecialBank, t_CheckREQ.SpecialHandling,
t_CheckREQ.OverNight, t_CheckREQ.PickUP, t_CheckREQ.SendCheck,
t_CheckREQ.AddComments, t_CheckREQ.thecosts, t_CheckREQ.Requestor,
t_CheckREQ.RequestorPhone, t_CheckREQ.Signature, t_CheckREQ.Department,
t_CheckREQ.ApprovedBy, t_CheckREQ.Asignature, t_CheckREQ.Title,
t_CheckREQ.Adepartment, t_CheckREQ.EMP, t_CheckREQ.President,
t_CheckREQ.Pdate
FROM t_CheckREQ;
Then use [ICNSR] as the field in the LinkChildFields and LinkMasterFields
properties of the subform control (the control on main form that holds the
subform object). The subform then will track with the ICNSR value that you
have showing in the main form, and the ICNSR value in the subform will be
filled in by ACCESS with the value from the main form.
--
Ken Snell
<MS ACCESS MVP>
Dan @BCBS said:
The Key is ICNSR - yes it's in the query.
The right join is the only way the key field populates on the new form:
This simple code on my button opens the new form and displays the key
field
related to the original form.. The other two joins also do not allow me
to
enter data except in the key field, which I do not what to enter the
data....
What am I missing????
stLinkCriteria = "[ICNSR]=" & "'" & Me![ICNSR] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Ken Snell (MVP) said:
Which field in the "t_CheckREQ" table is the primary key? Make sure that
it
is in the query's field list.
Also, you're using a RIGHT JOIN in the query, which is unusual for this
use
of the query (if I'm understanding your setup correctly). RIGHT JOIN
means
that the query will return all records from the "t_DataTracking" table
and
only matching records from the "t_CheckREQ" table (which I believe is the
new table?). More likely, you want to use INNER JOIN.
--
Ken Snell
<MS ACCESS MVP>
The reason I created a new table is because the information is
completely
seperate.
Here is the story: This database is many years old, users are all
throughout the State of Florida. I needed to add a form to produce a
check
request. There is a lot of information that needs to be on this form.
So, I
created the table with all the details for the check request. Then I
created
the form. Then I created a button from the original form which will
open
the
check request form linked by the Key.
This all works fine except when I try to enter data. The key field
shows
the correct record but the other fields do not allow input/edit...
SELECT t_DataTracking.ICNSR, t_CheckREQ.ChkREQ, t_CheckREQ.BCBSF,
t_CheckREQ.FCSO, t_CheckREQ.INCP, t_CheckREQ.FCL, t_CheckREQ.COI,
t_CheckREQ.FCIA, t_CheckREQ.NAVIGY, t_CheckREQ.BusinessUnit,
t_CheckREQ.Date,
t_CheckREQ.CHGmonetery, t_CheckREQ.CHGacct, t_CheckREQ.CHGcc,
t_CheckREQ.CHGrecipient, t_CheckREQ.CHGaffillate,
t_CheckREQ.CHGproduct,
t_CheckREQ.CHGmanacct, t_CheckREQ.CHGmanhour, t_CheckREQ.Total,
t_CheckREQ.Details, t_CheckREQ.SpecialBank, t_CheckREQ.SpecialHandling,
t_CheckREQ.OverNight, t_CheckREQ.PickUP, t_CheckREQ.SendCheck,
t_CheckREQ.AddComments, t_CheckREQ.thecosts, t_CheckREQ.Requestor,
t_CheckREQ.RequestorPhone, t_CheckREQ.Signature, t_CheckREQ.Department,
t_CheckREQ.ApprovedBy, t_CheckREQ.Asignature, t_CheckREQ.Title,
t_CheckREQ.Adepartment, t_CheckREQ.EMP, t_CheckREQ.President,
t_CheckREQ.Pdate
FROM t_CheckREQ RIGHT JOIN t_DataTracking ON t_CheckREQ.ICNSR =
t_DataTracking.ICNSR;