Access send e-mail (1 Viewer)

masa1

Registered User.
Local time
Yesterday, 18:26
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?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:26
Joined
Aug 30, 2003
Messages
36,125
You can use the Column property of the combo to get the name, presuming it's part of the row source.
 

masa1

Registered User.
Local time
Yesterday, 18:26
Joined
Oct 1, 2018
Messages
18
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".
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:26
Joined
Sep 21, 2011
Messages
14,287
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. :)
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:26
Joined
Aug 30, 2003
Messages
36,125
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)
 

masa1

Registered User.
Local time
Yesterday, 18:26
Joined
Oct 1, 2018
Messages
18
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.
 

masa1

Registered User.
Local time
Yesterday, 18:26
Joined
Oct 1, 2018
Messages
18
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:26
Joined
Aug 30, 2003
Messages
36,125
Happy to help!
 

Users who are viewing this thread

Top Bottom