1-
strSubject = QueryID & " - " & Fin_InvNo & " - " & Qry_QryType & "Query"
where are QueryID, Fin_InvNo, Qry_QryType defined? or are they control
within the subform?If so, I'd do
strSubject = Me.QueryID & " - " & Me.Fin_InvNo & " - " & Me.Qry_QryType &
"Query"
2- To ref forms and subforms... I use
Forms![FormName]![SubFormname]![...].Form.[ControlName]
So in your case simply use the simplest form of the above listed code
Forms![FormName].Form.[ControlName]
Daniel
"scubadiver" wrote:
> I posted a message yesterday about help with code for creating an email but
> maybe I am posting this too soon.
>
> At the moment I have the following:
>
> Private Sub Tracksht_Click()
>
> Dim strToWhom As String
> Dim strMsgBody As String
> Dim strSubject As String
>
> strSubject = QueryID & " - " & Fin_InvNo & " - " & Qry_QryType & "Query"
> strToWhom = ""
> strMsgBody = Qry_PropAddress1 & vbNewLine & Qry_Description
>
> DoCmd.SendObject , , , strToWhom, , , strSubject, strMsgBody, True
>
> End Sub
>
> I have two questions:
>
> 1) How do I compile text and fields into a string (as I have tried to do in
> the "strSubject" above but doesn't seem to work). Is there something I am
> missing?
>
> 2) The code above is in a button on the sub form. Some of the fields I
> require are from the main form. I have tried the usual referencing but
> doesn't work.
>
> Cheers
|