Get contents of field in a subform

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
 
M

Maurice

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top