Use of List box and 'Index or primary key cannot contain null"

Use of List box and 'Index or primary key cannot contain null"

Post by SnVsaW » Tue, 28 Oct 2008 20:43:00


Hi,
I have put a list box on a form that is set up to allow for multiple
choices. It gets its info from a table with the command SELECT HSALast FROM
HSA;
All seems to work fine in terms of it allowing you to select none, one, or
more of the items in the drop down list. I do have a problem though. If there
was something selected for this field (one or more items, makes no
difference) if I save the info and then come back and blank it out, trying to
leave the field blank, when I try to move out of the record (forward or
backwards) I get the message 'Index or primary key cannot contain null".

I would appreciate any advice. Thanks, Julie

--
Thanks for your help. Julie
 
 
 

Use of List box and 'Index or primary key cannot contain null"

Post by Douglas J. » Tue, 28 Oct 2008 22:44:50

What version of Access?

If it's Access 2003 or earlier, you cannot bind a multi-select list box.
Multi-select list boxes always return Null, regardless of whether anything's
been selected in the list box.


--
Doug Steele, Microsoft Access MVP
http://www.yqcomputer.com/
(no e-mails, please!)

 
 
 

Use of List box and 'Index or primary key cannot contain null"

Post by SnVsaW » Wed, 29 Oct 2008 02:24:03

Thanks for your reply Douglas. Sorry, should have said from the start that I
am using Access 2007.
--
Thanks for your help. Julie