A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multi-field index



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2009, 01:33 AM posted to microsoft.public.access.tablesdbdesign
lmcc007
external usenet poster
 
Posts: 63
Default Multi-field index

I have a tblPhoneNumber table with five fields:

PhoneNumID
PhoneTypeID
PhoneNumber
PhoneExt
CompanyID

I created two indexes using the Indexes button on the Show/Hide ribbon.

PhoneTypeIndex includes: PhoneTypeID and CompanyID. Which works--I can not
create the same phone type for a company.

PhoneNumberIndex includes: PhoneNumber and PhoneExt. It does not work. I
only want the phone number to be repeated if the phone extension is different.

What am I doing wrong?

Thanks!


  #2  
Old June 15th, 2009, 05:41 AM posted to microsoft.public.access.tablesdbdesign
Graham Mandeno
external usenet poster
 
Posts: 593
Default Multi-field index

If a value in an index field is Null, then that record is omitted from the
index. This seems to happen whether or not the IgnoreNulls property is set
for the index.

If your PhoneExt field is text, then set its properties Required and
AllowZeroLength to True. Then an "empty" field will actually contain a
zero-length string, instead of Null, and the index will function as
required.

If PhoneExt is numeric then one workaround would be to make it Required with
a DefaultValue of 0, then treat 0 as a special case meaning "no extension".

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"lmcc007" wrote in message
...
I have a tblPhoneNumber table with five fields:

PhoneNumID
PhoneTypeID
PhoneNumber
PhoneExt
CompanyID

I created two indexes using the Indexes button on the Show/Hide ribbon.

PhoneTypeIndex includes: PhoneTypeID and CompanyID. Which works--I can
not
create the same phone type for a company.

PhoneNumberIndex includes: PhoneNumber and PhoneExt. It does not work.
I
only want the phone number to be repeated if the phone extension is
different.

What am I doing wrong?

Thanks!




  #3  
Old June 15th, 2009, 08:52 PM posted to microsoft.public.access.tablesdbdesign
lmcc007
external usenet poster
 
Posts: 63
Default Multi-field index

Graham Mandeno,

Thank you so much! I knew it would be something very simple; my mine just
could not figure it out. I've been working on this since last Friday. I'm
just so happy it is working. Thanks!

"Graham Mandeno" wrote:

If a value in an index field is Null, then that record is omitted from the
index. This seems to happen whether or not the IgnoreNulls property is set
for the index.

If your PhoneExt field is text, then set its properties Required and
AllowZeroLength to True. Then an "empty" field will actually contain a
zero-length string, instead of Null, and the index will function as
required.

If PhoneExt is numeric then one workaround would be to make it Required with
a DefaultValue of 0, then treat 0 as a special case meaning "no extension".

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"lmcc007" wrote in message
...
I have a tblPhoneNumber table with five fields:

PhoneNumID
PhoneTypeID
PhoneNumber
PhoneExt
CompanyID

I created two indexes using the Indexes button on the Show/Hide ribbon.

PhoneTypeIndex includes: PhoneTypeID and CompanyID. Which works--I can
not
create the same phone type for a company.

PhoneNumberIndex includes: PhoneNumber and PhoneExt. It does not work.
I
only want the phone number to be repeated if the phone extension is
different.

What am I doing wrong?

Thanks!





 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.