Relationship

G

Guest

Is it possable to set up a relationship between two different tables.

Requests
REQIMEI (15 digit serial number)
Custoemr Name

Handsets
Manufacturer
Model
Prefix (6 digit prefix)

What i would like to do is to stetup a form whreby the handst model is
displayed each time an IMEI is entered. I have set up a dlookup function but
it only shows the mdoel when the form is closed then re-opened

Some help would be appreciated

Thanks
 
G

Guest

hi,
it is to my understanding that you have to have a common
field to define a relationship like an index id or unique
identifier. you don't have a common filed in either table.
read up on relationships in help.
 
G

Guest

With ieach IMEI being entered onto the database being unique i have set
REQimei as a primary key. In the Prefix List table i have also made the
prefix the primary key.
as each prefix is unique.
A relationship would work normally however witht the IMEI being 15 digits
and the prefix only being 6 (or the 1st 6 digits of the IMEI).

Te database is to be used for the
 
O

onedaywhen

storm said:
A relationship would work normally however witht the IMEI being 15 digits
and the prefix only being 6 (or the 1st 6 digits of the IMEI).

You can create a JOIN using these criteria e.g.

SELECT * FROM Requests INNER JOIN Handsets
ON LEFT(Requests.REQIMEI,6) = Handsets.Prefix;

but not a FOREIGN KEY.

Jamie.

--
 
T

Tim Ferguson

Is it possable to set up a relationship between two different tables.

Requests
REQIMEI (15 digit serial number)
Customer Name

Handsets
Manufacturer
Model
Prefix (6 digit prefix)

It depends on the nature of the relationship. If each handset is the
subject of one request (but a request can address lots of handsets), then
you'll need to put the RequestNumber field in the Handets table. If each
request concerns one handset (but a handset can be requested lots of
times), then you'll need the HandsetID field in the Requests table.

I think you have already had some advice about storing the IMEI number
when it is made up of two parts, the 6-digit Prefix and the 9-digit
Remainder. Is there a reason you decided to take no notice of that?

HTH


Tim F
 

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