Here is the code attached to my submit button to get the selected
recipients.
With Me.MsgRecipients
For Each varItem In .ItemsSelected
rst.AddNew
rst![CM_Date] = Format(Date, "yyyy-mm-dd")
rst![CM_Time] = Format(Time(), "Short Time")
rst![CM_From] = CurrentUser()
rst![CM_To] = varItem
rst![CM_Subject] = UCase(Me.MsgSubject)
rst![CM_Message] = UCase(Me.MsgDetails)
rst![CM_Priority] = strPri
rst![CM_Status] = "UNREAD"
rst.Update
Next varItem
End With
Douglas J. Steele said:
In that case, what's the code you're using to do the selection?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
"Scott Whetsell, A.S. - WVSP"
As best as I can tell it should be just one column. My listbox is
populated
by code to read the users in the mdw file. The code I used was
provided
by
Joan Wild:
Dim wrk As Workspace
Dim strUserName As String
Dim usr As User
Set wrk = DBEngine(0)
For Each usr In wrk.Users
If usr.Name <> "Admin" Then
strUsername = strUserName & ";" & usr.Name
End If
Next
Me.MsgRecipients.RowSource = strUserName
Set wrk = Nothing
:
If you have multiple columns in your list box, you can return the
correct
value by identifying the column you want. If the text is in say
column
2,
you would use
Me.MyListBox(1)
Column numbers for a list box start at 0.
--
Dave Hargis, Microsoft Access MVP
:
I have a multiselect listbox that lists all users in my MDW file.
After
making selections and submitting my form, the values that were
selected
are
not the text strings displayed in the lisbox, but rather numeric
values.
How do I return the text string?