Hi I'm having trouble inserting data from a sub form into an email message. I have a cmd button to send the email from the main form and i have data on my main form & subform that i want to include my code works fine but im unsure how to insert the subform information. Any help would be greatly apprciaeted. My Sub form is called sfrmPackageDetails
Private Sub cmdEmail_Click()
On Error GoTo ErrorHandler
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim strQuoteRef As String '-- The Quote Ref from form
Dim strWho As String '-- Reference to tblUsers
Dim strDespatch As String '-- Person who assigned
Dim strSQL As String '-- Create SQL update statement
Dim txtComments As String '-- The Packing option from form
'-- Combo of names to send Shipping quote to
strWho = Me.cboAssignee
stWhere = "tblUsers.strFirstName = " & "'" & strWho & "'"
'-- Looks up email address from tblUsers
varTo = DLookup("[strEMail]", "tblUsers", stWhere)
stSubject = ":: Packing Details ::"
strQuoteRef = Me.strQuoteRef
txtComments = Me.txtComments
txtPackageModeOfTransport = Me.txtPackageModeOfTransport
**txtType = Me.sfrmPackageDetails.Form!txtType**
**Im having trouble here with my subform**
stText = "Your packing quote is complete" & Chr$(13) & Chr$(13) & _
"Quote Ref : " & strQuoteRef & Chr$(13) & Chr$(13) & _
"Packing Details : " & txtComments & Chr$(13) & Chr$(13) & _
"Mode Of Transport : " & txtType
Thanks Steve
Private Sub cmdEmail_Click()
On Error GoTo ErrorHandler
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim strQuoteRef As String '-- The Quote Ref from form
Dim strWho As String '-- Reference to tblUsers
Dim strDespatch As String '-- Person who assigned
Dim strSQL As String '-- Create SQL update statement
Dim txtComments As String '-- The Packing option from form
'-- Combo of names to send Shipping quote to
strWho = Me.cboAssignee
stWhere = "tblUsers.strFirstName = " & "'" & strWho & "'"
'-- Looks up email address from tblUsers
varTo = DLookup("[strEMail]", "tblUsers", stWhere)
stSubject = ":: Packing Details ::"
strQuoteRef = Me.strQuoteRef
txtComments = Me.txtComments
txtPackageModeOfTransport = Me.txtPackageModeOfTransport
**txtType = Me.sfrmPackageDetails.Form!txtType**
**Im having trouble here with my subform**
stText = "Your packing quote is complete" & Chr$(13) & Chr$(13) & _
"Quote Ref : " & strQuoteRef & Chr$(13) & Chr$(13) & _
"Packing Details : " & txtComments & Chr$(13) & Chr$(13) & _
"Mode Of Transport : " & txtType
Thanks Steve