Access send e-mail

masa1

Registered User.
Local time
Today, 12:23
Joined
Oct 1, 2018
Messages
18
Hi everyone.

I have a form with a subform.
The subform has cascading combo boxes cboNazwa1, cboNazwaEtapu, cboName3 and the Send Email subform.
In the vba code of the Send email subform I have a string;

strNazwa = Format(Forms("frmHarmonogram_02").Form("frmHarmonogramRemontu02").Controls("cboNazwaEtapu"))

The data source for the "cboNazwaEtapu" combo box is a query.

Everything works fine!

However,
in the body of the e-mail, I would like to change the "ID" number to its full name.
I know I could get this by changing the combo box property - bound column, but it's not an elegant solution.
Could I please help?
 
You can use the Column property of the combo to get the name, presuming it's part of the row source.
 
You can use the Column property of the combo to get the name, presuming it's part of the row source.
I know this solution ...
"I know I could get this by changing the combo box property - bound column, but it's not an elegant solution."
In this case, I would populate the table with the full names and I would like to stay with "ID".
 
You are not getting what pbady is saying, or so I believe. :(

You do NOT change the bound column, you merely add extra column(s) and refer to those.? :unsure:

That is as elegant a solution as you are going to get. :)
 
I know this solution ...
"I know I could get this by changing the combo box property - bound column, but it's not an elegant solution."
In this case, I would populate the table with the full names and I would like to stay with "ID".

What I mean is that most combos return both the ID and the text. Presuming the text (name in your case) is in the second column:

Forms!frmHarmonogram_02.Form.frmHarmonogramRemontu02.cboNazwaEtapu.Column(1)
 
You are not getting what pbady is saying, or so I believe. :(

You do NOT change the bound column, you merely add extra column(s) and refer to those.? :unsure:

That is as elegant a solution as you are going to get. :)
Good morning.

Thank you for the clarification, "Gasman".:)

Best regards.
 
What I mean is that most combos return both the ID and the text. Presuming the text (name in your case) is in the second column:

Forms!frmHarmonogram_02.Form.frmHarmonogramRemontu02.cboNazwaEtapu.Column(1)
Good morning.

Thank you for your work "pbaldy" and the code you have included!(y)

I needed it, it works.

Thanks to you I took the next step.
Best regards.
 

Users who are viewing this thread

Back
Top Bottom