I need a field to appear on a report if not equal to another.

F

Frank Martin

I have Access2000 with WindowsXP

I have an address system to be printed out where one name can be associated
with another name, i.e. a person can have a home/work/holiday name with the
associated addess.

On the printout I want the associated name to appear below the first name
only when this latter is different.

I have tried:
Me.Text(PeopleI).Visible = (PeopleII = PeopleI)
and it does not work.

Can someone help me?
Regards Frank
 
D

Duane Hookom

Is there any way you could provide the names of your fields and a few sample
records with desired output?
 
F

Frank Martin

I am trying to send you a post will an attached zip file of only 134kb, but
the newsserver will not accept anything "so large".
Am I doing something wrong?
 
D

Duane Hookom

You are attempting to do something wrong (attaching files to messages). If
you want someone to take the time to provide some help, then please take the
time to type or past some information into a reply.
 
D

Duane Hookom

Deleted. I don't accept files without some previous agreement. Public news
groups don't work like that. I will only agree to accept a file after many
other tries have not succeeded.

Please just take the time to type or paste some information into a reply. If
you don't have time to do this then find someone to hire to work on your
project.
 
F

Frank Martin

I have a report "rptAddresses" to printout static data in the query
"qryAddresses". The qryAddresses consists of 5 tables viz:

1/ tblPeople (The names only of all people & companies.)

2/ tblPeopleType (Customer/Supplier/Contractor/Personal etc.)

3/ tblPeople_1 (The alias of tblPeople, used for the address
names so that the one table can be used for people & address names.)

4/ tblAddressType
(Account/delivery/head-office/home/work/freight/FOB/FIS/pickup etc).

5/ tblAddressDetails (containing all the static address details
with phone/fax/www etc. Together with, respectively, PeopleID, PeopleTypeID,
AddressNameID, AddressTypeID, and of course AddessesID for
tblAddressDetails.)

I only ever use the query design grid, but here is Access's display of the
equivalent SQL for qryAddresses:

SELECT AddressDetail.AddressesID, AddressDetail.PeopleID, People.People,
AddressDetail.PeopleTypeID, PeopleType.PeopleType, AddressDetail.AddrNameID,
People_1.People, AddressDetail.AddrTypeID, AddressType.AddressType,
AddressDetail.Address1, AddressDetail.Address2, AddressDetail.City,
AddressDetail.PostCode, AddressDetail.Country, AddressDetail.StreetDir,
AddressDetail.Telephone, AddressDetail.Fax, AddressDetail.Mobile,
AddressDetail.email, AddressDetail.www, AddressDetail.ShortName,
AddressDetail.Bank, AddressDetail.Comments, AddressDetail.ABN,
AddressDetail.PriceListMemo, AddressDetail.Contact1, AddressDetail.Contact2,
AddressDetail.Contact3, AddressDetail.Date

FROM PeopleType INNER JOIN (People INNER JOIN (AddressType INNER JOIN
(AddressDetail INNER JOIN People AS People_1 ON AddressDetail.AddrNameID =
People_1.PeopleID) ON AddressType.AddrTypeID = AddressDetail.AddrTypeID) ON
People.PeopleID = AddressDetail.PeopleID) ON PeopleType.PeopleTypeID =
AddressDetail.PeopleTypeID

ORDER BY People.People;

The rptAddresses is based on the qryAddesses and contains the following
fields:

People.People (The person/company name)
People.People_1 (The address name)
Address1
Address2
City
PostCode
Telephone
Fax

Etc

My problem is to suppress the printing of "People.People_1" when this is the
same as "People.People", which is most of the time.

I thought of some code such as:

If
AcCompare People.People = People.People-1
Then People.People_1.visible = false
EndIf

Which does not work.

And this is the problem.
 
D

Duane Hookom

Provide an aliase for one (or both) of the People fields. You should never
have two or more fields with the same name in a report or form's record
source.

SELECT AddressDetail.AddressesID, AddressDetail.PeopleID,
People.People as PPeople,
AddressDetail.PeopleTypeID, PeopleType.PeopleType, AddressDetail.AddrNameID,
People_1.People As P1People,
etc

You can then set a control source to:
=IIf(PPeople = P1People,"",P1People)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top