On Oct 30, 8:15 am, bluegrassstateworker <andy.crumbac...@gmail.com>
wrote:
> On Oct 29, 3:58 pm, Steve Schapel <scha...@mvps.org.ns> wrote:
>
>
>
> > Bluegrass,
>
> > Tabs on forms provide only for convenience, so whether your subforms are
> > on tabs or not is not relevant.
>
> > No, it just means you need to correctly reference the controls. And a
> > control on a subform is sort of a control within a control. So if I
> > understand you correctly, that the IFirstName control is on the
> > Individual subform, then that line of code would look like this:
>
> > strIndFirst = Nz(Me.Individual.Form.IFirstName, "Vacant or No Entry")
>
> > --
> > Steve Schapel, Microsoft Access MVP
>
> > bluegrassstateworker wrote:
> > > You are correct, the button does rest on a form in the POSITION
> > > table. This form has tabs: The INDIVIDUAL subform rests within the
> > > Position Form on one tab. The GROUP FORM is on another tab by itself
> > > and serves at the main tab. Most of my time has been spent in Excel
> > > VBA and Access VBA is a different enough. So would it be easier to
> > > create a new tab, bound to a query then pull from that?
>
> Thanks Steve! This appears to be what I need.
I spoke too soon. I am getting values but they are not correct. Are
coming from the wrong records from each table (on the screen and
navigationally they are correct). I thought I could establish the
recordset to point to the proper table then obtain the correct value.
My logic might be way off too. Any ideas/suggestions appreciated.
Sub SendEmail3()
'declarations
Dim MyDB As DAO.Database
Dim TblGroup As DAO.Recordset
Dim TblPosition As DAO.Recordset
Dim TblIndividual As DAO.Recordset
' Strings of fields defined here
Dim strGroupName As String
Dim strPositionDescription As String
Dim strIndividualName As String
.......
, Defines the tables to pull the information from
Set MyDB = CurrentDb
Set TblGroup = MyDB.OpenRecordset("Group")
Set TblPosition = MyDB.OpenRecordset("Position")
Set TblIndividual = MyDB.OpenRecordset("Individual")
'Captures Variables for the Text within the email and a TO: recipient
strGroupName = TblGroup.Fields("GName")
strPositionDescription = =TblPosition.Fields("PName")
strIndividualName = TblIndividual.Fields("IFullName")
'Formats the email message using the above data
'
strSubject = "Email Subject Text"
strText = "The position below will be expiring and will need to be
addressed. " & _
"If you need additional information, please feel free to contact me. "
& Chr(13) & Chr(13) & _
"Group: " & strGroupName & Chr(13) & _
"Position :" & strPositionDescription & Chr(13) & _
"Name of Current Member: " & strIndividualName
DoCmd.SendObject acSendNoObject, " ", "HTML", strTO, , , strSubject,
strText, True
TblGroup.Close
TblIndividual.Close
TblPosition.Close
End Sub
|