Showing Records - Sql Question

  • Thread starter Thread starter Sreedhar
  • Start date Start date
S

Sreedhar

Hi everyone,

Can somebody please show me how to do this ?

I'm using Access 2003 (mdb). I've two tables 'tblCustomers' and
'tblAccounts', which have Many-To-Many relationship, ie one customer can have
many accounts and an account can be linked to many customers.

Now, the problem is to show the 'other' records for a customer while showing
one, eg, I want to show in a Report :

Account No CustomerName PlanId Other Accounts subscribed
by this Customer
------------- ------------------ ------- ------------------------------
10010 Sreedhar 7 20020
30030
40040 etc.....

where, a Customer is having 4 accounts and while showing details of one
account, I've to show the 'all' the other accounts subscribed by the customer
'except' the current one.

Hope I've explained my problem correctly.

Thanks in advance for your valuable suggestions.
 
Alex Dybenko said:
Hi,
you can either make a subreport to show other accounts, or to write a
function, which will returns these other accounts as text strings and show
it result in textbox on report

The subreport simply shows up all the accounts for a customer (the master
and child link fields being the CustomerID) which is not exactly what I want.
Yes, I can use recordsets to populate a textbox manually with the required
records. I was just wondering if a good sql can make life simpler.

(btw, I'm very weak in writing sql, access query builder compensates for me
which is one of the reasons why I like Access so much.)
 
Back
Top