powerman9
asked on
How to use a conditional value from a subform in Access 2016 database using Access VBA
Hi! I'm having some trouble with some code I am trying to put together. I am very much a beginner, so this could be a really simple problem. Basically, I have a subform that uses information from the parent form and and another subform to create an email. I am not having any issues generating the email, but what I want to do is create body text using a text field in the subform only if a related field is "true" (it's a yes no field). Right now I have
I want Parent!ClientPitchParagrap hTbl_subfo rm.Form!Pi tchParagra ph to only be used if the related field "active" is set to "true". Do I have to create a string or is there a simple declaration?
Thanks in advance.
l_Msg.HTMLBody = "<!DOCTYPE html><body style=""font:normal normal normal 11pt/11pt calibri;"">" & _
"<div>Hi" & " " & Me!PitchCastingFirstName & "!<br><br>" & _
"I'd like to submit" & " " & UCase((Parent!FirstName) & " " & Nz(Parent!LastName)) & " for the role of " & Nz(Me!PitchRole) & "." & _
" " & Parent!ClientPitchParagraphTbl_subform.Form!PitchParagraph & _
"</div></body></html>" _
I want Parent!ClientPitchParagrap
Thanks in advance.
Where is your related "active" field? Is it on the main form, or on one of those subforms?
ASKER
It is on the subform.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked perfectly. Thank you so much!
ASKER
Clear, fast and concise answer. Thank you, Scott!