PC Review


Reply
Thread Tools Rate Thread

Build Table Index Based on a field value?

 
 
saraqpost@yahoo.com
Guest
Posts: n/a
 
      1st Sep 2006
I am not sure if this can be done using the Index on Table Design, or
if I have to do something else.

I have a table: tblInvoices, which has InvoiceDate, InvoiceNumber,
InvoiceStatus.

If the user requests "delete", I simply change the status from "A"
(default) to "D".

I created a unique index to prevent the user from adding the same
invoice twice:
InvoiceDate
InvoiceNumber
InvoiceStatus

One user (not sure why) added a record, then deleted it, then added the
same information again, then tried to delete it again, and (of course)
the index stopped her from doing that.

Is there anyway to just have an index on the "A" value of Status? So
InvoiceDate, InvoiceNumber, and InvoiceStatus = "A".

I don't think I care how many "D" records there are that are
"identical".

Thanks -
sara

 
Reply With Quote
 
 
 
 
strive4peace
Guest
Posts: n/a
 
      1st Sep 2006
Hi Sara,

"Is there anyway to just have an index on the "A" value of Status?"

No

"If the user requests "delete", I simply change the status from "A"
(default) to 'D'"

If you want to keep multiple deleted records, add a sequential number
after D ... but if there is already a D, it would be simplest to delete
or archive ... don't keep them in the same table -- or, depending on why
your needs, you will be constantly filtering them out for your reports



Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



(E-Mail Removed) wrote:
> I am not sure if this can be done using the Index on Table Design, or
> if I have to do something else.
>
> I have a table: tblInvoices, which has InvoiceDate, InvoiceNumber,
> InvoiceStatus.
>
> If the user requests "delete", I simply change the status from "A"
> (default) to "D".
>
> I created a unique index to prevent the user from adding the same
> invoice twice:
> InvoiceDate
> InvoiceNumber
> InvoiceStatus
>
> One user (not sure why) added a record, then deleted it, then added the
> same information again, then tried to delete it again, and (of course)
> the index stopped her from doing that.
>
> Is there anyway to just have an index on the "A" value of Status? So
> InvoiceDate, InvoiceNumber, and InvoiceStatus = "A".
>
> I don't think I care how many "D" records there are that are
> "identical".
>
> Thanks -
> sara
>

 
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
Pivot Table - Add calculated field using field number (index) vs n Preston Bandy Microsoft Excel Programming 0 7th Dec 2009 07:57 AM
Next record after based on a sorted field not index Chris Salcedo Microsoft Access Form Coding 2 22nd Jun 2009 05:12 PM
Build a like query based on information contained in another table Tom Microsoft Access Queries 1 8th Sep 2008 07:20 PM
The most efficient way to build a new data table based DataTable.Select result Maxwell2006 Microsoft C# .NET 1 6th Nov 2006 06:38 AM
Create table with field names based on the value of a field in another table. simon_minder@hotmail.com Microsoft Access Database Table Design 5 24th May 2004 02:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 PM.