Get contents of field in a subform

  • Thread starter Thread starter LDMueller
  • Start date Start date
L

LDMueller

I have a form named frmTicOpenAsgnTab based off my TICKET table. On this
form I have a JOURNAL tab which holds the subform sfJournal (based off my
JOURNAL table) and is a Continuous Form.

On the subform sfJournal I have the field EntryText which is a field in the
JOURNAL table. The tables TICKET and JOURNAL are linked by the TicketID in a
one to many relationship.

I have a command button named cmdEmailUser located on the main form where I
need stText to equal the contents of the EntryText field. My code is as
follows but line for stText is what doesn't work.

stText = Forms!frmTicOpenAsgnTab.sfJournal.EntryText

'-- Write the e-mail content for sending
DoCmd.SendObject , , acFormatTXT, From, CCTo, BCCTo, stSubject, stText, -1
strSql = "UPDATE TicketSub SET TicketSub.UserEmailed = -1 " & _
"Where TicketSub.TicketID = " & Me.TicketID & ";"

Can anyone help me.

Thanks,

LDMueller
 
Try this:

stText = Forms!frmTicOpenAsgnTab!sfJournal.form.EntryText

but I doubt if you'll get the right values back. I think you should set the
focus to the designated field first because referring to a continuous form is
always tricky..
hth
 
Back
Top