Not getting the correct record from query -- create Unique Index on multiple fields in table design

Not getting the correct record from query -- create Unique Index on multiple fields in table design

Post by strive4pea » Fri, 30 Jun 2006 10:17:01


ou're welcome :)

***

for resolution of the problem allowing a duplicate
combination into the table that must be unique:

make a unique index in the table on a multi-field combination

From the table design, Turn on the Indexes window (from the
menu: View, Indexes)

click on the first field in the table design and set the
Index property to
Yes (duplicates ok)

that will add a line to the Indexes window

In the row just below the index you just made, in the 2nd
column of the indexes window, click in the fieldname column
and choose the 2nd fieldname
In the row below

If you have another field to add, click on the fieldname
column in the next row down, then on the drop-down arrow,
and choose the 3rd fieldname

Now, Click on top row of that Index, the first fieldname
(row) -- set
Unique --> Yes

-------------

to delete a record that is already saved...

the code you have written in your last message is not
complete because you are not executing the SQL ... besides,
if they click the checkbox, they could be turning it off
(deleting a record) or turning it on (adding a record)

firstly, make the default value of me.invited --> false

then use the code I gave you in my first post to this thread
-- it tests the Invited checkbox and either adds or deletes
a record accordingly. After you specify the SQL,

you need to RUN it :)
currentdb.execute s

then refresh the tables
currentdb.tabledefs.refresh
me.requery



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

skk wrote: