Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2006

Tip: Looking for answers? Try searching our database.

Multi Select Names on a Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Implacable - 27 Nov 2006 20:06 GMT
Hi everybody! I am trying to multi select in a list box but i get this error
message:
The field <name> cannot contain a Null value because the Required property
for this field is set to True. Enter a value in this field. (Error 3314)
What I am trying to do is to select names from a table and store them in
another table (employees who took a class on this date). I could only do it
if i select only one, if I enable multi select either simple or extended
that is when i get this message. Is there any macro or code that would let
me do
this task? Thanks!
Douglas J. Steele - 27 Nov 2006 20:20 GMT
Multiselect list boxes always return Null, regardless of how many records
may be selected in them.

You need to loop through all of the entries in the control's ItemsSelected
collection. Here's an example from the Help file:

Sub BoundData()
Dim frm As Form, ctl As Control
Dim varItm As Variant

Set frm = Forms!Contacts
Set ctl = frm!Names
For Each varItm In ctl.ItemsSelected
 Debug.Print ctl.ItemData(varItm)
Next varItm
End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi everybody! I am trying to multi select in a list box but i get this
> error
[quoted text clipped - 8 lines]
> me do
> this task? Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.