473,809 Members | 2,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update reverse cross reference?

I have a table that acts as a cross reference to related records. No
we can't get different data, no we have no control over what we have,
we just need to be able to manage what we have been given. lol
Anyway, what I have created so far is working well. I have a subform
on a tab of a main customer entry form. It says "related customers".

My issue is this: When you go to one record, you may see 4 customer
records relating to it. If you go to any of those 4, you only see the
first record, as if it is a master.

I am wondering if there is a way to right a query, that can update the
table to populate all relationships.

Here is what it looks like now:

CustomerID RCustomerID
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242111 24219
242112 24219
242113 24219

So when I am on record 33219, I see that 242110, 242111, 242112, and
242113 are related. But, if I go to any of the records for 242110,
242111, 242112, or 242113, I only see that 33219 is related. I would
like to see that 242110, 242111, 242112, and 242113 are related too.

I would like the table to look like this:

CustomerID RCustomerID
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242110 242111
242110 242112
242110 242113
242111 24219
242111 242110
242111 242112
242111 242113
242112 24219
242112 242110
242112 242111
242112 242113
242113 24219
242113 242110
242113 242111
242113 242112

I can see it in my head (along with a monkey and a clown on a
unicycle...) but I can't figure out how I would write this in what I
would think would be an append query. Any thoughts?

Thanks!

Aug 20 '07 #1
4 1749
Could you use a UNION query to get this both ways around:

SELECT CustomerID AS A, RCustomerID AS B FROM Table1
UNION ALL
SELECT RCustomerID AS A, CustomerID AS B FROM Table1;

--
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.

"no****@thankyo u.com" <mi*****@yahoo. comwrote in message
news:11******** **************@ l22g2000prc.goo glegroups.com.. .
>I have a table that acts as a cross reference to related records. No
we can't get different data, no we have no control over what we have,
we just need to be able to manage what we have been given. lol
Anyway, what I have created so far is working well. I have a subform
on a tab of a main customer entry form. It says "related customers".

My issue is this: When you go to one record, you may see 4 customer
records relating to it. If you go to any of those 4, you only see the
first record, as if it is a master.

I am wondering if there is a way to right a query, that can update the
table to populate all relationships.

Here is what it looks like now:

CustomerID RCustomerID
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242111 24219
242112 24219
242113 24219

So when I am on record 33219, I see that 242110, 242111, 242112, and
242113 are related. But, if I go to any of the records for 242110,
242111, 242112, or 242113, I only see that 33219 is related. I would
like to see that 242110, 242111, 242112, and 242113 are related too.

I would like the table to look like this:

CustomerID RCustomerID
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242110 242111
242110 242112
242110 242113
242111 24219
242111 242110
242111 242112
242111 242113
242112 24219
242112 242110
242112 242111
242112 242113
242113 24219
242113 242110
242113 242111
242113 242112

I can see it in my head (along with a monkey and a clown on a
unicycle...) but I can't figure out how I would write this in what I
would think would be an append query. Any thoughts?

Thanks!
Aug 20 '07 #2
On Aug 20, 10:41 am, "Allen Browne" <AllenBro...@Se eSig.Invalid>
wrote:
Could you use a UNION query to get this both ways around:

SELECT CustomerID AS A, RCustomerID AS B FROM Table1
UNION ALL
SELECT RCustomerID AS A, CustomerID AS B FROM Table1;

--
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.

Thank you for the quick response. I tried this out, and it just gives
me this part of things:

242110 24219
242111 24219
242112 24219
242113 24219

Aug 20 '07 #3
Hey, I got one that kind of works... (you got me thinking!)

SELECT tblRelated.Rela tedMemberID, tblRelated_1.Me mberID
FROM tblRelated INNER JOIN tblRelated AS tblRelated_1 ON
tblRelated.Memb erID = tblRelated_1.Re latedMemberID;
The only thing lacking is that it gives me this:

CustomerID RCustomerID
33219 33219
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242110 242110
242110 242111
242110 242112
242110 242113
242111 24219
242111 242111
242111 242110
242111 242112
242111 242113
242112 24219
242112 242110
242112 242111
242112 242112
242112 242113
242113 24219
242113 242110
242113 242111
242113 242112
242113 242113

In case that is too much to look at, it is showing each customer
related to itself, as well as everything else. I would like to
supress that somehow. Any thoughts on that?

Thanks!

Aug 20 '07 #4
How about adding criteria under MemberID of:

<[RelatedMemberID]

--
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.

"no****@thankyo u.com" <mi*****@yahoo. comwrote in message
news:11******** **************@ m37g2000prh.goo glegroups.com.. .
Hey, I got one that kind of works... (you got me thinking!)

SELECT tblRelated.Rela tedMemberID, tblRelated_1.Me mberID
FROM tblRelated INNER JOIN tblRelated AS tblRelated_1 ON
tblRelated.Memb erID = tblRelated_1.Re latedMemberID;
The only thing lacking is that it gives me this:

CustomerID RCustomerID
33219 33219
33219 242110
33219 242111
33219 242112
33219 242113
242110 24219
242110 242110
242110 242111
242110 242112
242110 242113
242111 24219
242111 242111
242111 242110
242111 242112
242111 242113
242112 24219
242112 242110
242112 242111
242112 242112
242112 242113
242113 24219
242113 242110
242113 242111
242113 242112
242113 242113

In case that is too much to look at, it is showing each customer
related to itself, as well as everything else. I would like to
supress that somehow. Any thoughts on that?

Thanks!
Aug 20 '07 #5

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

Similar topics

9
1934
by: Art | last post by:
Can I update Application("SomeVariableName") on server A in response to user's action on server B? There is no problem in updating the same variable on server B, of course, but we would like both variables to be in sync since users can view the value stored on arbitrary server. So far I have tried server.execute and server.transer to execute script updating Application("SomeVariableName") value on server A in response to user's action on...
1
1057
by: C.P. | last post by:
I am trying to transform data inside one of my tables. However, I only want to change part of the data in a column because the last part is basically a UniqueID to a file. Is it possible to only change part of it? Here is what the column looks like. I have thousands of these. D:\oldpath\Content\Data\{File1} D:\oldpath\Content\Previews\Micro\{File1}.jpg D:\oldpath\Content\Previews\Mini\{File1}.jpg
8
675
by: xiao zhang yu | last post by:
me was sorry if this question are present before DotNet, no matter VB.Net or C# all they are compiled to IL, and yes, that IL will totally same as "open-sourse", every IL will easy to decompile and get the source nicety, although there have comeout with some "obfuscators" solution, but the structure still remain exactly same as the source after obfuscate. me unable to understand what the benefit will IL bring to me, is that benefit of...
5
2157
by: Chad | last post by:
Could any suggest to me a good way to programmatically identify which SPs update a database column. I would like to create a cross reference for our database.
3
1558
by: Lapchien | last post by:
A user has a make table query, basically it does some summing and creates a 'summary' table. I'd like to get rid of it (it's the last one in the access back-end) and use pure sql. Is the same thing easy enough to accomplish in sql or would you still need to make the table in the FE and then update the (same) table in sql..? -- Thanks, Lap
5
2000
by: Dave Smithz | last post by:
Hi there, Been working on an evolving DB program for a while now. Suddenly I have come across a situation where I need to update a table based on a group by query. For example, I have a table called "students". I need to update a field called "status" on this table for all members that have never attended a class. Class attendance is recorded by another table (which represents the many to
20
19802
by: mike7411 | last post by:
Is there any easy way to reverse the order of the bits in a byte in C++? (i.e. 00000001 becomes 10000000)
1
10763
by: sunnyluthra1 | last post by:
Hi, I was creating an Application in MS Access for Geocoding a particular Address from Google to get the Lat & Long. I successfully able to did that. Here is the code: **************************** On Error Resume Next 'if address not found, just move along Dim xml_document As DOMDocument Set xml_document = New DOMDocument Dim rootNode As IXMLDOMNode
0
9721
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
9603
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
10376
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
10387
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
10120
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...
1
7662
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
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
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
3861
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.