Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email from sub form

Status
Not open for further replies.

SteveMck

Technical User
Apr 17, 2007
8
GB
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top