Hi ken sorry I have taken that out now it was a query which I copyed from
another form which has a multiselect list box which passes the select made
to a query. I have changed the query to
SELECT DISTINCT tblSubscribers.Title, tblSubscribers.Forename,
tblSubscribers.Surname, tblSubscribers.Company, tblSubscribers.Address,
tblSubscribers.City, tblSubscribers.[Country/Region],
tblSubscribers.PostalCode, tblsubscriptions.Cattypes
FROM tblSubscribers INNER JOIN tblsubscriptions ON
tblSubscribers.MailingListID=tblsubscriptions.MailingListID
WHERE (((tblsubscriptions.Cattypes) In ('4') Or
(tblsubscriptions.Cattypes)='2' Or (tblsubscriptions.Cattypes)='3' Or
(tblsubscriptions.Cattypes)='4' Or (tblsubscriptions.Cattypes)='5' Or
(tblsubscriptions.Cattypes)='6' Or (tblsubscriptions.Cattypes)='7' Or
(tblsubscriptions.Cattypes)='8') AND ((tblsubscriptions.Catcost)='Paid' Or
(tblsubscriptions.Catcost)='Free' Or (tblsubscriptions.Catcost)='Trial'))
ORDER BY tblSubscribers.Surname;
bu I am still getting subscript out of range when I am trying to create a
report.
The report needed has to have the subscribers names and addresses on out
of
tblsubscribers and there catalogue subscriptions which is found in
tblsubscriptions any ideas??
Cheers
Simon
Ken Snell said:
Just guessing, but why are you using an IN clause for just one value and
then doing other matching for .Cattypes?
SELECT DISTINCT tblSubscribers.Title, tblSubscribers.Forename,
tblSubscribers.Surname, tblSubscribers.Company, tblSubscribers.Address,
tblSubscribers.City, tblSubscribers.[Country/Region],
tblSubscribers.PostalCode, tblsubscriptions.Cattypes
FROM tblSubscribers INNER JOIN tblsubscriptions ON
tblSubscribers.MailingListID=tblsubscriptions.MailingListID
WHERE (((tblsubscriptions.Cattypes)='4' Or
(tblsubscriptions.Cattypes)='2' Or (tblsubscriptions.Cattypes)='3' Or
(tblsubscriptions.Cattypes)='4' Or (tblsubscriptions.Cattypes)='5' Or
(tblsubscriptions.Cattypes)='6' Or (tblsubscriptions.Cattypes)='7' Or
(tblsubscriptions.Cattypes)='8') AND ((tblsubscriptions.Catcost)='Paid'
Or
(tblsubscriptions.Catcost)='Free' Or (tblsubscriptions.Catcost)='Trial'))
ORDER BY tblSubscribers.Surname;
--
Ken Snell
<MS ACCESS MVP>
Simonglencross said:
Still getting subscript out of range??
with the following
SELECT DISTINCT tblSubscribers.Title, tblSubscribers.Forename,
tblSubscribers.Surname, tblSubscribers.Company, tblSubscribers.Address,
tblSubscribers.City, tblSubscribers.[Country/Region],
tblSubscribers.PostalCode, tblsubscriptions.Cattypes
FROM tblSubscribers INNER JOIN tblsubscriptions ON
tblSubscribers.MailingListID=tblsubscriptions.MailingListID
WHERE (((tblsubscriptions.Cattypes) In ('4') Or
(tblsubscriptions.Cattypes)='2' Or (tblsubscriptions.Cattypes)='3' Or
(tblsubscriptions.Cattypes)='4' Or (tblsubscriptions.Cattypes)='5' Or
(tblsubscriptions.Cattypes)='6' Or (tblsubscriptions.Cattypes)='7' Or
(tblsubscriptions.Cattypes)='8') AND ((tblsubscriptions.Catcost)='Paid' Or
(tblsubscriptions.Catcost)='Free' Or (tblsubscriptions.Catcost)='Trial'))
ORDER BY tblSubscribers.Surname;
Any further ideas?
Simon
Simonglencross wrote:
I'm looking for a little bit of help. I am trying to create a report
using
the following qutie but I am getting the message subscript out of
range!
Has
anyone any ideqas why?
SELECT DISTINCT tblSubscribers.Title, tblSubscribers.Forename,
tblSubscribers.Surname, tblSubscribers.Company, tblSubscribers.Address,
tblSubscribers.City, tblSubscribers.[Country/Region],
tblSubscribers.PostalCode, tblsubscriptions.Cattypes
FROM tblSubscribers INNER JOIN tblsubscriptions ON
tblSubscribers.MailingListID=tblsubscriptions.MailingListID
WHERE (((tblsubscriptions.Cattypes) In ('4') Or
(tblsubscriptions.Cattypes)=('2') Or (tblsubscriptions.Cattypes)=('3')
Or
(tblsubscriptions.Cattypes)=('4') Or (tblsubscriptions.Cattypes)=('5')
Or
(tblsubscriptions.Cattypes)=('6') Or (tblsubscriptions.Cattypes)=('7')
Or
(tblsubscriptions.Cattypes)=('8')) AND
((tblsubscriptions.Catcost)='Paid' Or
(tblsubscriptions.Catcost)='Free' Or
(tblsubscriptions.Catcost)='Trial'))
ORDER BY tblSubscribers.Surname;
Should be
WHERE (((tblsubscriptions.Cattypes) In ('4') Or
(tblsubscriptions.Cattypes)='2' Or (tblsubscriptions.Cattypes)='3' Or
(tblsubscriptions.Cattypes)='4' Or (tblsubscriptions.Cattypes)='5' Or
(tblsubscriptions.Cattypes)='6' Or (tblsubscriptions.Cattypes)='7' Or
(tblsubscriptions.Cattypes)='8')
... etc. ...