John-
Then make a query for your subform on CustInfo and CID (make sure the two tables are linked in the query). Include the customer name from CustInfo and all the fields from CID. After you make that the Row Source of your subform, you can display the related customer name on each row. You probably should set the Locked property of that control to Yes so that users can't inadvertently change the customer name in the related table.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On May 23, 2014, at 9:09 PM, John Heinze shelbysalpha@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Here is what I am trying to do. I have tables CustInfo & CID linked with the account number. I would like to add a field/column in my CID table that would display the Company field from the CustInfo table which is associated with the account number.
."The only real mistake is the one from which we learn nothing."
John Powell (1834-1902)
John Powell (1834-1902)
"Patience is the companion of wisdom."
Saint Augustine (354 AD - 430 AD)
Saint Augustine (354 AD - 430 AD)
"Success is the ability to go from one failure
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, May 23, 2014 12:41 PM
Subject: Re: [MS_AccessPros] Related sub form control
John-
That info doesn't help much. I suspect you need to add the Customers table to the query for the subform, then include that customer name in a locked control on the subform.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On May 23, 2014, at 6:32 PM, John Heinze shelbysalpha@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I dragged the control from the CustInfo form to the CID form.
CustInfo has the customer name.
The account number is the Primary key in CustInfo and the Foreign key in CID.
."The only real mistake is the one from which we learn nothing."
John Powell (1834-1902)
John Powell (1834-1902)
"Patience is the companion of wisdom."
Saint Augustine (354 AD - 430 AD)
Saint Augustine (354 AD - 430 AD)
"Success is the ability to go from one failure
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Friday, May 23, 2014 10:36 AM
Subject: Re: [MS_AccessPros] Related sub form control
John-
If the subform is Continuous or Datasheet view, there's really only ONE copy of each control. If your control to display the customer name is in the Detail section and is unbound, it will display the same value on all records.
What are the Recordsets of the outer and subform, which recordset has the customer name, and what in the subform records links to customer name?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On May 23, 2014, at 4:00 PM, John Heinze shelbysalpha@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I have a sub form which has the customer name field from the form on it. I am trying to loop through the sub form record set and display the customer name from the sub form but the customer name doesn't change. The customer name is whichever record I am on in the form and is displayed for every record in the sub form. How do I get the customer name to "change" as I loop through the sub form?
."The only real mistake is the one from which we learn nothing."
John Powell (1834-1902)
John Powell (1834-1902)
"Patience is the companion of wisdom."
Saint Augustine (354 AD - 430 AD)
Saint Augustine (354 AD - 430 AD)
"Success is the ability to go from one failure
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
__._,_.___
Posted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (8) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar