Can not obtain certain field

Jonny

Registered User.
Local time
Today, 14:03
Joined
Aug 12, 2005
Messages
144
I built a form that feeds data to tblOrders. In this form I have a button "Send", that must send a message to person from tblPersons.
I have a problem to get an "email" from tblPersons.
Any assistance will kindly appreciated.

Code:

Private Sub btnSend_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

mess_body = "Dear " & PersonID & "," & vbCrLf & vbCrLf

With MailOutLook
.To = PersonID ' <-- here
.Subject = "Order Accepted"
.Display
End With
End Sub


Attached also tables relationships.
 

Attachments

  • untitled.JPG
    untitled.JPG
    23.5 KB · Views: 95
Wow, thanks a lot.
Did not know this function before.

And if I need to display on report "SupplierName" , that base on "SuppliedID". What should I do with "SuppliedID", to turn it to visible = false?
 
You can also use a join in a query to include the SupplierName field in the recordset.
 

Users who are viewing this thread

Back
Top Bottom