Solved .HTMLBody Email Form including Option Frame Item (1 Viewer)

Trevor G

Registered User.
Local time
Today, 15:19
Joined
Oct 1, 2009
Messages
2,341
Hi everyone,

I have been looking to create a form to email a query list, this works well but I have been asked to add an extra feature. A frame with option buttons providing from a list of 5 options and the sender wants to be able to select which one to be included. The list is positions:

Option frame list name is optPosition with a list choice of:

1 = Admin
2 = Sales
3 = Resources
4 = Finance
5 = Director

I can't work out how to add this into the code. Currently when I display the emails it shows the name as indicated below in red, the line of code is shown below:

.HTMLBody = "<font face=""Arial"" size=3>" & Forms!frmmail!MainText.Value & "</Font><br><br>" & "<font face=""Viner Hand ITC"" size=3 color=""blue"">" & Forms!frmmail!sender.Value & "</font><br> & forms!frmail!optPosition.1" & "<br><font face=""Arial"" size=3 color=""blue"">Test Email<br></Font> "


Can someone take a look and guide me please.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,477
Hi. Are you saying you want the email to have an option group in it? If so, for what purpose?
 

Trevor G

Registered User.
Local time
Today, 15:19
Joined
Oct 1, 2009
Messages
2,341
Thank you for the reply, no I am preparing an access form for people to fill in like writing an email that uses a query to send individual emails to them. The form has the usual textboxes and named:

txtSubject
MainText
Sender

These work fine so the email displays the content

I am adding a frame into the form with options to select from the titles as mentioned and only the selected title is then to be added into the email below the senders name. Like a signature block example would be:

Maintext ="Sample email being sent"
Sender = "Trevor G"
optPosition = 2

so from my list optOption 2 would include the title "Sales"

I hope this clarifies my question?
 

Trevor G

Registered User.
Local time
Today, 15:19
Joined
Oct 1, 2009
Messages
2,341
I have resolved this by adding an extra textbox for the Position and once the person has selected from the position list it adds the title into the textbox and I have then successfully included this into the email.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:19
Joined
Oct 29, 2018
Messages
21,477
I have resolved this by adding an extra textbox for the Position and once the person has selected from the position list it adds the title into the textbox and I have then successfully included this into the email.
Hi. Glad to hear you got it sorted out. I was going to suggest using a Select Case statement. Good luck with your project.
 

Minty

AWF VIP
Local time
Today, 15:19
Joined
Jul 26, 2013
Messages
10,371
As you have discovered the option group only returns the number value of the option selected.
You have to translate that into the text you want, as DBGuy suggested a select case statement would be the normal way to go.
 

Trevor G

Registered User.
Local time
Today, 15:19
Joined
Oct 1, 2009
Messages
2,341
Thank you for your suggestions and the Good luck. I have applied this now.:)
 

Users who are viewing this thread

Top Bottom