Seeing 'ID' instead 'Name'

Jonny

Registered User.
Local time
Today, 22:36
Joined
Aug 12, 2005
Messages
144
Hello friends,

I wrote some code for sending email from when I pressing the button in a form.
But when the message is opening , instead 'Me.DeliveredBy', 'Me.ManufacturerName ' and 'Me.SupplierName' I see only their 'IDs", and not the name.

Any advise, what's wrong?

Private Sub btnSendReceipt_Click()
On Error GoTo Err_btnSendReceipt_Click

Dim stDocName As String

stDocName = "Samples"
DoCmd.SendObject acSendNoObject, stDocName, acFormatHTML, _
Me.DeliveredBy, , , _
"Your Samples Have Received", _
"SLF#: " & Me.txtSLF & vbCrLf & _
"Our Item: " & Me.Item & vbCrLf & _
"Supplier Name: " & Me.SupplierName & vbCrLf & _
"Manufacturer Name: " & Me.ManufacturerName & vbCrLf & _
"Manufacturer Part Number: " & Me.ManufacturerPN & vbCrLf & _
"Quantity Received: " & Me.Quantity & vbCrLf & _
"Received On: " & Me.Received_Date() _
, True

Exit_btnSendReceipt_Click:
Exit Sub

Err_btnSendReceipt_Click:
MsgBox Err.Description
Resume Exit_btnSendReceipt_Click
End Sub

I attached all printscreens.
 

Attachments

  • email.JPG
    email.JPG
    54.6 KB · Views: 103
  • relationship.JPG
    relationship.JPG
    33.1 KB · Views: 96
I tried to follow your advise and canceled all "look up fields".
When I'm pressing combo box of SupplierID, I want to see not ID , but Supplier Name.
I added in 'Row Source' property of my form following "SELECT tblSuppliers.SupplierName FROM tblSuppliers ORDER BY tblSuppliers.SupplierName"

..but getting error "The value you entered isn't valid for this field", the reason for that my table expects to get a number, but in Coombo I want to show the name (that is text).

What I'd doing wrong?
 
You have to use:

Code:
"SELECT tblSuppliers.SupplierID,tblSuppliers.SupplierName FROM tblSuppliers ORDER BY tblSuppliers.SupplierName"

And then in the number of columns property put 2
and in the column widths put: 0";2"

That way it will show the text but it will store the ID, which is what it is wanting.
 
Bob, you gave me a good push with this.
I understood a number of my mistakes.
Thank you a lot
 

Users who are viewing this thread

Back
Top Bottom