PC Review


Reply
Thread Tools Rate Thread

2 fields on an Index statement???

 
 
=?Utf-8?B?cm95X3dhcmU=?=
Guest
Posts: n/a
 
      23rd Feb 2005
Is it possible to use 2 indices on a single seek? My table has the following
indices: Unit and Name. The table logic is that a single unit may have up
to 11 different names associated with it. Therefore, to get a unique read,
the two keys need to be "joined" in the seek statement. Here's what I have
got so far:

recTemp.Index = "Unit" & "ResidentName"
recTemp.Seek "=", AptUnit, ResName

The problem here is that the index combines the two names and, of course,
cannot find the "UnitResidentName" column. I've tried using a comma, but to
no avail.

Are there any options other than creating a primary key field that combines
these two values?
 
Reply With Quote
 
 
 
 
Rick B
Guest
Posts: n/a
 
      23rd Feb 2005
Rick Brandt (that is not me) just answered this same question in the QUERIES
newsgroup a few hours ago. The subject is "Creating an Index on Two
Fields".

Rick B



"roy_ware" <(E-Mail Removed)> wrote in message
news80BE4E8-FB80-46F2-91E2-(E-Mail Removed)...
> Is it possible to use 2 indices on a single seek? My table has the

following
> indices: Unit and Name. The table logic is that a single unit may have

up
> to 11 different names associated with it. Therefore, to get a unique

read,
> the two keys need to be "joined" in the seek statement. Here's what I

have
> got so far:
>
> recTemp.Index = "Unit" & "ResidentName"
> recTemp.Seek "=", AptUnit, ResName
>
> The problem here is that the index combines the two names and, of course,
> cannot find the "UnitResidentName" column. I've tried using a comma, but

to
> no avail.
>
> Are there any options other than creating a primary key field that

combines
> these two values?



 
Reply With Quote
 
=?Utf-8?B?cm95X3dhcmU=?=
Guest
Posts: n/a
 
      23rd Feb 2005
Mucho gracias, Senor!

"Rick B" wrote:

> Rick Brandt (that is not me) just answered this same question in the QUERIES
> newsgroup a few hours ago. The subject is "Creating an Index on Two
> Fields".
>
> Rick B
>
>
>
> "roy_ware" <(E-Mail Removed)> wrote in message
> news80BE4E8-FB80-46F2-91E2-(E-Mail Removed)...
> > Is it possible to use 2 indices on a single seek? My table has the

> following
> > indices: Unit and Name. The table logic is that a single unit may have

> up
> > to 11 different names associated with it. Therefore, to get a unique

> read,
> > the two keys need to be "joined" in the seek statement. Here's what I

> have
> > got so far:
> >
> > recTemp.Index = "Unit" & "ResidentName"
> > recTemp.Seek "=", AptUnit, ResName
> >
> > The problem here is that the index combines the two names and, of course,
> > cannot find the "UnitResidentName" column. I've tried using a comma, but

> to
> > no avail.
> >
> > Are there any options other than creating a primary key field that

> combines
> > these two values?

>
>
>

 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      24th Feb 2005
"=?Utf-8?B?cm95X3dhcmU=?=" <(E-Mail Removed)> wrote in
news80BE4E8-FB80-46F2-91E2-(E-Mail Removed):

>
> recTemp.Index = "Unit" & "ResidentName"
> recTemp.Seek "=", AptUnit, ResName
>


PARAMETERS AptUnit TEXT, ResName TEXT;
SELECT * FROM MyTable
WHERE Unit=[AptUnit] AND ResidentName = [ResName];


Hope that helps?


Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add if blank statement to index match Diddy Microsoft Excel Worksheet Functions 6 3rd Nov 2009 09:56 PM
index, Match statement Bob Microsoft Excel Worksheet Functions 2 20th Aug 2009 12:40 AM
IF statement circumvent with Criteria or VBA,vlookup, index =?Utf-8?B?bWlrZQ==?= Microsoft Excel Misc 9 24th Aug 2007 12:57 AM
if/index statement. =?Utf-8?B?U3RldmVu?= Microsoft Excel Worksheet Functions 4 7th Jun 2004 03:56 PM
If Statement or Index Dominique Feteau Microsoft Excel Worksheet Functions 0 21st Jan 2004 04:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 PM.