473,734 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating rows in a table - HELP, I'm beating my head against the wall.

Here's the situation:

I'm trying to use an update query to copy data from one row to another.
Here is the situation:

I have 5 companies that are linked to each other. I need to show all 5
companies on a form. 3 of the companies have common employees. I have a
table that looks like this:
Row ID Company Common Company Common EEs (checkboxes)
1 A B
2 A C
3 A D
4 A E
5 B A
6 B C
7 B D
8 B E
9 C A
10 C B
11 C D
12 C E
13 D A
14 D B
15 D C
16 D E

and so on.

If I were to look at Company A in a form, in the form header I have:

Company A

In the detail section (as a continuous form) I show it's linked companies:

Company B
Company C
Company D
Company E

With a checkbox next to each name in the detail section.

In this scenario, company B and D have common employees with company A. So,
when you check the box next to B, I have a query that will check the row
with Company A and Company B (row 1) and the row with Company B and Company
A (row 5). The same with Company A and Company D. When you check the box
next to Company D, the update query with update row 3 (A and D) and row 13
(D and A).

So, now company A and company B have the same info. Company A and company D
have the same info. BUT, company B and company D (rows 7 and 14) also need
to be checked and this isn't happening. How do I update those rows??

Thanks in advance,

Laura
Nov 13 '05 #1
4 2278
Laura, this sounds like a maintenance nightmare!

You need Access to calculate this for you at runtime, and you could achieve
that if you had these 3 tables:

Company table:
CompanyID primary key

Employee table:
EmployeeID primary key

CompanyEmployee table:
CompanyID foreign key to Company.Company ID
EmployeeID foreign key to Employee.Employ eeID
Now create two queries:

1. Create a query into the CompanyEmployee table.
Drag a 2nd copy of the CompanyEmployee table into the grid.
Access will alias it as CompanyEmployee _1.

2. In the upper pane, create a join between CompanyEmployee .EmployeeID and
CompanyEmployee _1.EmployeeID. If you see a join between
CompanyEmployee .CompanyID and CompanyEmployee _1.CompanyID, delete that line.

3. Drag CompanyEmployee .CompanyID into the query grid.
Type this into the Field row:
CommonCompanyID :[CompanyEmployee _1].[CompanyID]
In the Criteria row under this field, enter:
<> CompanyEmployee .CompanyID.

4. Save the query with the name qryEmployeeBoth . Close.
This query shows each matching company that has shared employees, and lists
who they are.
1. Create a new query into the Company table and also the query you just
saved. If you don't see a line joining Company.Company ID to qryEmployeeID,
then drag the one field onto the other. Double-click the join line. Access
pops up a dialog offereing 3 choices. Choose the one that says:
All records from Company, and any matches from ...

2. Depress the Totals button on the toobar.
Access adds a Total row to the grid.

3. Drag Company.Company ID and qryEmployeeBoth .CommonCompanyI D into the grid.
Accept Group By under these fields.

4. Drag qryEmployeeBoth .EmployeeID into the grid. In the Total row, choose
Count.

This query lists every company matched against any other companies that have
shared employees, and the number of shared employees.

This willbe the SQL for the 2 queries:
SELECT CompanyEmployee .CompanyID, CompanyEmployee .EmployeeID,
CompanyEmployee _1.CompanyID AS CommonCompanyID
FROM CompanyEmployee INNER JOIN CompanyEmployee AS
CompanyEmployee _1 ON CompanyEmployee .EmployeeID =
CompanyEmployee _1.EmployeeID
WHERE CompanyEmployee _1.CompanyID <> [CompanyEmployee].[CompanyID];
SELECT Company.Company ID, qryEmployeeBoth .CommonCompanyI D,
Count(qryEmploy eeBoth.Employee ID) AS CountOfEmployee ID
FROM Company LEFT JOIN qryEmployeeBoth
ON Company.Company ID = qryEmployeeBoth .CompanyID
GROUP BY Company.Company ID, qryEmployeeBoth .CommonCompanyI D;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:fO******** *********@fe1.t exas.rr.com...
Here's the situation:

I'm trying to use an update query to copy data from one row to another.
Here is the situation:

I have 5 companies that are linked to each other. I need to show all 5
companies on a form. 3 of the companies have common employees. I have a
table that looks like this:
Row ID Company Common Company Common EEs (checkboxes)
1 A B
2 A C
3 A D
4 A E
5 B A
6 B C
7 B D
8 B E
9 C A
10 C B
11 C D
12 C E
13 D A
14 D B
15 D C
16 D E

and so on.

If I were to look at Company A in a form, in the form header I have:

Company A

In the detail section (as a continuous form) I show it's linked companies:

Company B
Company C
Company D
Company E

With a checkbox next to each name in the detail section.

In this scenario, company B and D have common employees with company A.
So, when you check the box next to B, I have a query that will check the
row with Company A and Company B (row 1) and the row with Company B and
Company A (row 5). The same with Company A and Company D. When you check
the box next to Company D, the update query with update row 3 (A and D)
and row 13 (D and A).

So, now company A and company B have the same info. Company A and company
D have the same info. BUT, company B and company D (rows 7 and 14) also
need to be checked and this isn't happening. How do I update those rows??

Thanks in advance,

Laura

Nov 13 '05 #2
There isn't a need for an employees table. I just need to know if common
employees may exist between the two companies. I don't need a list of them.

Here is the actual update query that occurs when the check box is checked:

UPDATE tblCombinedPlan s SET tblCombinedPlan s.CommonEEs =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[CommonEEs], tblCombinedPlan s.Census =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[Census]
WHERE (((tblCombinedP lans.GA_Number) =[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_GA_Number]) AND
((tblCombinedPl ans.PlanNum)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PlanNum]) AND
((tblCombinedPl ans.PYE)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PYE]) AND
((tblCombinedPl ans.C_GA_Number )=[forms]![frmGroups]![GA_Number]) AND
((tblCombinedPl ans.C_PlanNum)=[forms]![frmGroups]![PlanNum]) AND
((tblCombinedPl ans.C_PYE)=[forms]![frmGroups]![PYE]));

The fields on the table are:

These three denote the company
GA_Number
PlanNum
PYE

These three denote the linked or 'common' company.
C_GA_Number
C_PlanNum
C_PYE

These are the two checkboxes.
CommonEEs
Census

As you can see from the query above, I made GA_Number = C_GA_Number, etc.
This allowed me to reverse the values.

I was thinking that maybe I should use vb. The table is relatively static
except for the 2 checkboxes. I haven't worked it out completely yet, but I
think I could store the 6 values of a record, then reverse them, and create
a dynamic update query.

Do you think that would work?

Thanks,
Laura

P.S. I love, love, love your website. I found it more than 6 years ago when
I was forced to teach myself Access and couldn't get my mind around how to
do a dynamic dlookup. You are wonderful at explaining things. Thank ypu so
much for all the help over the years.
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Laura, this sounds like a maintenance nightmare!

You need Access to calculate this for you at runtime, and you could
achieve that if you had these 3 tables:

Company table:
CompanyID primary key

Employee table:
EmployeeID primary key

CompanyEmployee table:
CompanyID foreign key to Company.Company ID
EmployeeID foreign key to Employee.Employ eeID
Now create two queries:

1. Create a query into the CompanyEmployee table.
Drag a 2nd copy of the CompanyEmployee table into the grid.
Access will alias it as CompanyEmployee _1.

2. In the upper pane, create a join between CompanyEmployee .EmployeeID and
CompanyEmployee _1.EmployeeID. If you see a join between
CompanyEmployee .CompanyID and CompanyEmployee _1.CompanyID, delete that
line.

3. Drag CompanyEmployee .CompanyID into the query grid.
Type this into the Field row:
CommonCompanyID :[CompanyEmployee _1].[CompanyID]
In the Criteria row under this field, enter:
<> CompanyEmployee .CompanyID.

4. Save the query with the name qryEmployeeBoth . Close.
This query shows each matching company that has shared employees, and
lists who they are.
1. Create a new query into the Company table and also the query you just
saved. If you don't see a line joining Company.Company ID to qryEmployeeID,
then drag the one field onto the other. Double-click the join line. Access
pops up a dialog offereing 3 choices. Choose the one that says:
All records from Company, and any matches from ...

2. Depress the Totals button on the toobar.
Access adds a Total row to the grid.

3. Drag Company.Company ID and qryEmployeeBoth .CommonCompanyI D into the
grid. Accept Group By under these fields.

4. Drag qryEmployeeBoth .EmployeeID into the grid. In the Total row, choose
Count.

This query lists every company matched against any other companies that
have shared employees, and the number of shared employees.

This willbe the SQL for the 2 queries:
SELECT CompanyEmployee .CompanyID, CompanyEmployee .EmployeeID,
CompanyEmployee _1.CompanyID AS CommonCompanyID
FROM CompanyEmployee INNER JOIN CompanyEmployee AS
CompanyEmployee _1 ON CompanyEmployee .EmployeeID =
CompanyEmployee _1.EmployeeID
WHERE CompanyEmployee _1.CompanyID <> [CompanyEmployee].[CompanyID];
SELECT Company.Company ID, qryEmployeeBoth .CommonCompanyI D,
Count(qryEmploy eeBoth.Employee ID) AS CountOfEmployee ID
FROM Company LEFT JOIN qryEmployeeBoth
ON Company.Company ID = qryEmployeeBoth .CompanyID
GROUP BY Company.Company ID, qryEmployeeBoth .CommonCompanyI D;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:fO******** *********@fe1.t exas.rr.com...
Here's the situation:

I'm trying to use an update query to copy data from one row to another.
Here is the situation:

I have 5 companies that are linked to each other. I need to show all 5
companies on a form. 3 of the companies have common employees. I have a
table that looks like this:
Row ID Company Common Company Common EEs (checkboxes)
1 A B
2 A C
3 A D
4 A E
5 B A
6 B C
7 B D
8 B E
9 C A
10 C B
11 C D
12 C E
13 D A
14 D B
15 D C
16 D E

and so on.

If I were to look at Company A in a form, in the form header I have:

Company A

In the detail section (as a continuous form) I show it's linked
companies:

Company B
Company C
Company D
Company E

With a checkbox next to each name in the detail section.

In this scenario, company B and D have common employees with company A.
So, when you check the box next to B, I have a query that will check the
row with Company A and Company B (row 1) and the row with Company B and
Company A (row 5). The same with Company A and Company D. When you
check the box next to Company D, the update query with update row 3 (A
and D) and row 13 (D and A).

So, now company A and company B have the same info. Company A and
company D have the same info. BUT, company B and company D (rows 7 and
14) also need to be checked and this isn't happening. How do I update
those rows??

Thanks in advance,

Laura


Nov 13 '05 #3
Laura, what bothers me is the non-normalized data structure, where you have
one record dependent on another. That *is* the problem that you are trying
to solve by forcing the update of the other record when one changes. To me,
that approach would be unacceptable, e.g. if the write fails for some reason
(e.g. another user is editing that record), your database gradually becomes
more and more wrong over time.

Some kind of junction table(s) between 2 instances of the company table
seems to be a more reliable approach.

Thanks for the comments re the website. Like many of the regular
contributors here, I enjoy empowering people to achieve things for
themselves.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:0R******** **********@fe1. texas.rr.com...
There isn't a need for an employees table. I just need to know if common
employees may exist between the two companies. I don't need a list of
them.

Here is the actual update query that occurs when the check box is checked:

UPDATE tblCombinedPlan s SET tblCombinedPlan s.CommonEEs =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[CommonEEs], tblCombinedPlan s.Census =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[Census]
WHERE (((tblCombinedP lans.GA_Number) =[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_GA_Number]) AND
((tblCombinedPl ans.PlanNum)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PlanNum]) AND
((tblCombinedPl ans.PYE)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PYE]) AND
((tblCombinedPl ans.C_GA_Number )=[forms]![frmGroups]![GA_Number]) AND
((tblCombinedPl ans.C_PlanNum)=[forms]![frmGroups]![PlanNum]) AND
((tblCombinedPl ans.C_PYE)=[forms]![frmGroups]![PYE]));

The fields on the table are:

These three denote the company
GA_Number
PlanNum
PYE

These three denote the linked or 'common' company.
C_GA_Number
C_PlanNum
C_PYE

These are the two checkboxes.
CommonEEs
Census

As you can see from the query above, I made GA_Number = C_GA_Number, etc.
This allowed me to reverse the values.

I was thinking that maybe I should use vb. The table is relatively static
except for the 2 checkboxes. I haven't worked it out completely yet, but
I think I could store the 6 values of a record, then reverse them, and
create a dynamic update query.

Do you think that would work?

Thanks,
Laura

P.S. I love, love, love your website. I found it more than 6 years ago
when I was forced to teach myself Access and couldn't get my mind around
how to do a dynamic dlookup. You are wonderful at explaining things.
Thank ypu so much for all the help over the years.
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Laura, this sounds like a maintenance nightmare!

You need Access to calculate this for you at runtime, and you could
achieve that if you had these 3 tables:

Company table:
CompanyID primary key

Employee table:
EmployeeID primary key

CompanyEmployee table:
CompanyID foreign key to Company.Company ID
EmployeeID foreign key to Employee.Employ eeID
Now create two queries:

1. Create a query into the CompanyEmployee table.
Drag a 2nd copy of the CompanyEmployee table into the grid.
Access will alias it as CompanyEmployee _1.

2. In the upper pane, create a join between CompanyEmployee .EmployeeID
and CompanyEmployee _1.EmployeeID. If you see a join between
CompanyEmployee .CompanyID and CompanyEmployee _1.CompanyID, delete that
line.

3. Drag CompanyEmployee .CompanyID into the query grid.
Type this into the Field row:
CommonCompanyID :[CompanyEmployee _1].[CompanyID]
In the Criteria row under this field, enter:
<> CompanyEmployee .CompanyID.

4. Save the query with the name qryEmployeeBoth . Close.
This query shows each matching company that has shared employees, and
lists who they are.
1. Create a new query into the Company table and also the query you just
saved. If you don't see a line joining Company.Company ID to
qryEmployeeID, then drag the one field onto the other. Double-click the
join line. Access pops up a dialog offereing 3 choices. Choose the one
that says:
All records from Company, and any matches from ...

2. Depress the Totals button on the toobar.
Access adds a Total row to the grid.

3. Drag Company.Company ID and qryEmployeeBoth .CommonCompanyI D into the
grid. Accept Group By under these fields.

4. Drag qryEmployeeBoth .EmployeeID into the grid. In the Total row,
choose Count.

This query lists every company matched against any other companies that
have shared employees, and the number of shared employees.

This willbe the SQL for the 2 queries:
SELECT CompanyEmployee .CompanyID, CompanyEmployee .EmployeeID,
CompanyEmployee _1.CompanyID AS CommonCompanyID
FROM CompanyEmployee INNER JOIN CompanyEmployee AS
CompanyEmployee _1 ON CompanyEmployee .EmployeeID =
CompanyEmployee _1.EmployeeID
WHERE CompanyEmployee _1.CompanyID <> [CompanyEmployee].[CompanyID];
SELECT Company.Company ID, qryEmployeeBoth .CommonCompanyI D,
Count(qryEmploy eeBoth.Employee ID) AS CountOfEmployee ID
FROM Company LEFT JOIN qryEmployeeBoth
ON Company.Company ID = qryEmployeeBoth .CompanyID
GROUP BY Company.Company ID, qryEmployeeBoth .CommonCompanyI D;
"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:fO******** *********@fe1.t exas.rr.com...
Here's the situation:

I'm trying to use an update query to copy data from one row to another.
Here is the situation:

I have 5 companies that are linked to each other. I need to show all 5
companies on a form. 3 of the companies have common employees. I have a
table that looks like this:
Row ID Company Common Company Common EEs (checkboxes)
1 A B
2 A C
3 A D
4 A E
5 B A
6 B C
7 B D
8 B E
9 C A
10 C B
11 C D
12 C E
13 D A
14 D B
15 D C
16 D E

and so on.

If I were to look at Company A in a form, in the form header I have:

Company A

In the detail section (as a continuous form) I show it's linked
companies:

Company B
Company C
Company D
Company E

With a checkbox next to each name in the detail section.

In this scenario, company B and D have common employees with company A.
So, when you check the box next to B, I have a query that will check the
row with Company A and Company B (row 1) and the row with Company B and
Company A (row 5). The same with Company A and Company D. When you
check the box next to Company D, the update query with update row 3 (A
and D) and row 13 (D and A).

So, now company A and company B have the same info. Company A and
company D have the same info. BUT, company B and company D (rows 7 and
14) also need to be checked and this isn't happening. How do I update
those rows??

Thanks in advance,

Laura

Nov 13 '05 #4
MA

"Allen Browne" <Al*********@Se eSig.Invalid> ha scritto nel messaggio
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Laura, what bothers me is the non-normalized data structure, where you have one record dependent on another. That *is* the problem Oh J thought the the problem was be or not to be!!!
Damn J've to study better Access...
that you are trying
to solve by forcing the update of the other record when one changes. To me, that approach would be unacceptable, e.g. if the write fails for some reason (e.g. another user is editing that record), your database gradually becomes more and more wrong over time.

Some kind of junction table(s) between 2 instances of the company table
seems to be a more reliable approach.

Thanks for the comments re the website. Like many of the regular
contributors here, I enjoy empowering people to achieve things for
themselves.
Sorry for jocking, J'm completly agree with you answer
MAssimiliano

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:0R******** **********@fe1. texas.rr.com...
There isn't a need for an employees table. I just need to know if common employees may exist between the two companies. I don't need a list of
them.

Here is the actual update query that occurs when the check box is checked:
UPDATE tblCombinedPlan s SET tblCombinedPlan s.CommonEEs =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[CommonEEs], tblCombinedPlan s.Census =
[Forms]![frmgroups].[Subform BasicCase].[Form].[AddlPlans
Subform].[Form].[Census]
WHERE (((tblCombinedP lans.GA_Number) =[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_GA_Number]) AND
((tblCombinedPl ans.PlanNum)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PlanNum]) AND
((tblCombinedPl ans.PYE)=[Forms]![frmgroups].[Subform
BasicCase].[Form].[AddlPlans Subform].[Form].[C_PYE]) AND
((tblCombinedPl ans.C_GA_Number )=[forms]![frmGroups]![GA_Number]) AND
((tblCombinedPl ans.C_PlanNum)=[forms]![frmGroups]![PlanNum]) AND
((tblCombinedPl ans.C_PYE)=[forms]![frmGroups]![PYE]));

The fields on the table are:

These three denote the company
GA_Number
PlanNum
PYE

These three denote the linked or 'common' company.
C_GA_Number
C_PlanNum
C_PYE

These are the two checkboxes.
CommonEEs
Census

As you can see from the query above, I made GA_Number = C_GA_Number, etc. This allowed me to reverse the values.

I was thinking that maybe I should use vb. The table is relatively static except for the 2 checkboxes. I haven't worked it out completely yet, but I think I could store the 6 values of a record, then reverse them, and
create a dynamic update query.

Do you think that would work?

Thanks,
Laura

P.S. I love, love, love your website. I found it more than 6 years ago
when I was forced to teach myself Access and couldn't get my mind around
how to do a dynamic dlookup. You are wonderful at explaining things.
Thank ypu so much for all the help over the years.
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Laura, this sounds like a maintenance nightmare!

You need Access to calculate this for you at runtime, and you could
achieve that if you had these 3 tables:

Company table:
CompanyID primary key

Employee table:
EmployeeID primary key

CompanyEmployee table:
CompanyID foreign key to Company.Company ID
EmployeeID foreign key to Employee.Employ eeID
Now create two queries:

1. Create a query into the CompanyEmployee table.
Drag a 2nd copy of the CompanyEmployee table into the grid.
Access will alias it as CompanyEmployee _1.

2. In the upper pane, create a join between CompanyEmployee .EmployeeID
and CompanyEmployee _1.EmployeeID. If you see a join between
CompanyEmployee .CompanyID and CompanyEmployee _1.CompanyID, delete that
line.

3. Drag CompanyEmployee .CompanyID into the query grid.
Type this into the Field row:
CommonCompanyID :[CompanyEmployee _1].[CompanyID]
In the Criteria row under this field, enter:
<> CompanyEmployee .CompanyID.

4. Save the query with the name qryEmployeeBoth . Close.
This query shows each matching company that has shared employees, and
lists who they are.
1. Create a new query into the Company table and also the query you just saved. If you don't see a line joining Company.Company ID to
qryEmployeeID, then drag the one field onto the other. Double-click the
join line. Access pops up a dialog offereing 3 choices. Choose the one
that says:
All records from Company, and any matches from ...

2. Depress the Totals button on the toobar.
Access adds a Total row to the grid.

3. Drag Company.Company ID and qryEmployeeBoth .CommonCompanyI D into the
grid. Accept Group By under these fields.

4. Drag qryEmployeeBoth .EmployeeID into the grid. In the Total row,
choose Count.

This query lists every company matched against any other companies that
have shared employees, and the number of shared employees.

This willbe the SQL for the 2 queries:
SELECT CompanyEmployee .CompanyID, CompanyEmployee .EmployeeID,
CompanyEmployee _1.CompanyID AS CommonCompanyID
FROM CompanyEmployee INNER JOIN CompanyEmployee AS
CompanyEmployee _1 ON CompanyEmployee .EmployeeID =
CompanyEmployee _1.EmployeeID
WHERE CompanyEmployee _1.CompanyID <> [CompanyEmployee].[CompanyID];
SELECT Company.Company ID, qryEmployeeBoth .CommonCompanyI D,
Count(qryEmploy eeBoth.Employee ID) AS CountOfEmployee ID
FROM Company LEFT JOIN qryEmployeeBoth
ON Company.Company ID = qryEmployeeBoth .CompanyID
GROUP BY Company.Company ID, qryEmployeeBoth .CommonCompanyI D;
"Laura" <musicloverlch@ (removethis)yah oo.com> wrote in message
news:fO******** *********@fe1.t exas.rr.com...
Here's the situation:

I'm trying to use an update query to copy data from one row to another. Here is the situation:

I have 5 companies that are linked to each other. I need to show all 5 companies on a form. 3 of the companies have common employees. I have a table that looks like this:
Row ID Company Common Company Common EEs (checkboxes)
1 A B
2 A C
3 A D
4 A E
5 B A
6 B C
7 B D
8 B E
9 C A
10 C B
11 C D
12 C E
13 D A
14 D B
15 D C
16 D E

and so on.

If I were to look at Company A in a form, in the form header I have:

Company A

In the detail section (as a continuous form) I show it's linked
companies:

Company B
Company C
Company D
Company E

With a checkbox next to each name in the detail section.

In this scenario, company B and D have common employees with company A. So, when you check the box next to B, I have a query that will check the row with Company A and Company B (row 1) and the row with Company B and Company A (row 5). The same with Company A and Company D. When you
check the box next to Company D, the update query with update row 3 (A
and D) and row 13 (D and A).

So, now company A and company B have the same info. Company A and
company D have the same info. BUT, company B and company D (rows 7 and 14) also need to be checked and this isn't happening. How do I update
those rows??

Thanks in advance,

Laura


Nov 13 '05 #5

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

Similar topics

0
1789
by: Bob Kaku | last post by:
I'm trying to create a text editing and updating capability to help someone who wants to maintain content on a web page without having to know any HTML or use a web authoring tool and FTP'ng the contents. I've already created a screen whereby the person can create new content with a PHP program that inserts into a MySQL table. But, I'm having a little trouble in creating the edit/update functionality. Can somebody help me out? Thanks. ...
3
5074
by: Robert Nolan | last post by:
This subject is probably simple to the readers, but I must be having one hell of a mental block cause I am beating my head against a wall. I need to create a simple folder tree that is about 3 levels deep and about 50 folders wide. The file (folder) names will have spaces in them, so if I try to make a batch (.bat) file to use the mkdir command, I create a folder for each word in the string..... not the desired output. help point me in...
6
3147
by: Allan | last post by:
Ok, I got some good advise. I re-wrote the program and now I'm down to only 1 error. Below is my code and my error. Any ideas what it is? #include <iostream> using std::cout; using std::cin; using std::endl; // Function main begins program execution
1
1732
by: Ron | last post by:
I have a pre-printed form that I've basically duplicated in Access 2000 with the form wizards. It uses a main form for the basic info on a client, then a subform for the transaction lines. I've tweaked it "just a bit" with code for defaults and stuff, but otherwise, it's pretty much the way the wizards created it (both main form and sub-form). However, I need to either limit the number of transactions my user can input, or limit the...
10
1091
by: Donald French | last post by:
I have posted this before and got n real help. I have been beating my head against the wall over this one. Everytime I try to create a new web application I get this message. I have done the following uninstalled IIS removed Inetpub reinstalled IIS ran aspnet_regiis
5
1611
by: Jeremy | last post by:
This is a variation on the last 2 unresolved questions I've posted. Having removed the "required" attribute from a field that was causing trouble, I'm finding that my dataAdapter update gets values into some fields, but not others. Inspecting the single row in my dataset, I see the correct values, but they don't arrive at the table. Other columns, however, do. This is extremely frustrating. I considered the possibility that...
1
2424
by: Jozef | last post by:
HELP! Hi Folks, I'm having trouble referencing these public variables, and I'm not sure why. I use the code below to set open a connection to a database. The variables are public variables and I hadn't had any problems previously, but I seem to be having trouble now. I could have modified it between the time it last worked and now (while I was cleaning up some of the code) but I don't recall touching anything.
2
3113
by: Muzzy | last post by:
Hi, I've used information on these newsgroups to build many pages. So I thought that now that I have my script working (something that I've been working on for about a week), I should post it so that it may help others. If posting this script is against the rules in this group then please accept my appologies. I developped this script so that I can add and remove rows in a table in which I have various input fields and I would use the...
28
3264
by: jverri01 | last post by:
First, I am relatively new to working with variables. Most of my experience has been with interface design. i am using ACCESS ver. 2003, running in Windows XP. Second, I spent an hour searching through articles and posts to make sure the information I am seeking is not already posted on the site. I am beating my head against the wall trying to figure out something that seems like it should be very simple. The trouble is I do not fully...
0
8776
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
9449
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...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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,...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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
4550
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2180
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.