Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP... BRAIN FART!!!

Status
Not open for further replies.

lancemeroniuk

Technical User
Nov 1, 2001
22
0
0
CA
Hi all

I'm having a brain fart.... I need to have a refence only box.. IE I have a querry list for address location by I want the address of the location to show as well.

Also.... When I run a querry it keeps inputing all 22 addresses. Some record info but with each diffrent address listed as a seperate record

I know there is a simple reason... but I just can't think about it.


 
Not sure I understand your first question. But with regard to the second, can you use Unique Records to solve it?

Tom
 
Hi,

Your question is a little confusing.

Please be a little more detailed... like how many tables are in the query? Does the location and the location address come from the same table or is it the result of the query you are running?

Usually the reason for your second q is becaus the tables in the query have no reference to each other. You may have to add something like...

where Table1.ID = Table2.Table1ID

...in your select query.

eg...

Select CustomersName, OrderAmount from Customers, Orders where Customers.CustomerID = Orders.CustomerID
and Customers.CustomerID = 100



Emma




 
Hi all....

Sorry about the lack of detail about my question... I have one table for the client info and one that has the location of hotel address name, address, phone number...ect....

I thought that if I selected the hotel's name as unique that I could not use it over again...

Maybe I'm confuesed??

Thanks in advance

Lance
 
I think that you are getting confused with Unique record selection and Unique id's.

1) You should always give your table data a unique ID... most of the time this is an AutoNumber, so that it cannot be lost, overridden or confused with another record row.

2) You select UNIQUE records through a select query...
eg.. select distinctrow, select distinctcol.

sounds like you have tables like....

CLIENT
---------
ClientID (Unique...autonumber?, Alpha code?)
ClientName
ClientOccupation
ClientPhone
etc...


HOTEL
----------
HotelID (Unique...)
HotelName
HotelAddress
HotelPhone
ClientID (This is the relation between the two tables)

This way you can select from the two tables like this....

if you want to select all the clients in a certain hotel..

Select * from CLIENT, HOTEL
where HotelID = [HotelID]
and HOTEL.ClientID = CLIENT.ClientID


or
if you want to select the Hotels that the client has been to...


Select * from CLIENT, HOTEL
where ClientID = [ClientID]
and HOTEL.ClientID = Client.ClientID

The [HotelID] and [ClientID] represent the ID's that are inputted by you or the user. Either by a query or a parameter or a form etc...

The above set of tables are based on a one->many relationship.

ONE Hotel -> MANY CLients

Hope this helps,

Emma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top