Contents of list box into an email

cavscout

Registered User.
Local time
Today, 17:24
Joined
Mar 13, 2003
Messages
74
I have a DB for requesting Details of Products. My sales coordinator enters the Job information on a form linked to a Request table and enters the parts needed in a subform linked to a Detail Table. I'm using code to create an email populated with data from the Job Info form and want to also include the list of details they have requested from the Detail subform.

I tried using a list box to get the values from the subform up to the form but I could not get the list to print in the email.

I may be going at this the long way so if anyone can help me streamline this, great! Or if you can connect the two points of getting the subform list into my email that would be awesome!

Here is the code I'm using:

'Email Notice

Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurrFile As String

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

With olMail
.To = "Cavscout"
.Subject = SalesCoord & " entered a Detail Requisition."
.Body = SalesCoord & " has requested a detail('s) for " & vbCr & vbCr & Agent & "," & vbCr & vbCr & _
" for the following systems:" & vbCr & vbCr & ProductsList
.Send
End With

Set olMail = Nothing
Set olApp = Nothing

Please let me know if I have been unclear about anything.

Thanks in advance.
 
I just needed to set the multi select property of the list box to "simple". And then anything that is selected in the list box will be sent to my email. Pretty cool feature.

I still think I may be doing this the long way, but it works.
 

Users who are viewing this thread

Back
Top Bottom