Combo box column(1) property (1 Viewer)

gakiss2

Registered User.
Local time
Today, 05:12
Joined
Nov 21, 2018
Messages
168
EmailSubject = " Notification: " & Me.NewLBTrackNo & " Status: " & Me.DocStep & " Due: " & Me.DueDate

I am using a button to send and email. All is working well except one detail I can't figure out. In the above you can see … Me.DocStep & ….

Right now that give a number which is the 'ID number' of the step. What I want in this spot is the actual name of the Step. There is a tblDocSteps which contains that information and which the combo box is based. I understand that the zero column is that 'index number' and the (1) column is the column that contains the actual name of the step and its what I want.

Looking for advice on Google I found the following

Forms!formname!controlname.column(1) In my case formname is frmDocDetail and the control name is DocStep which is a Combo Box.

It seems it should work but I have tried it exactly as shown as well as Me.DocStep.Column(1) and I have tried with '.' instead of '!'. when it runs (button to launch code to send email) I get an error message. That is unless I just use Me.DocStep. That works fine but doesn't give me what I want.

I would appreciate any help on this headbanger. One work around is to build an If then based on the index value which would basically recreate what is in the table but that seems just not the right way to go about it when the information is there already
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:12
Joined
Sep 21, 2011
Messages
14,051
Well it depends on the order of the fields for your combo?, but the index starts at zero.?

I normally have the ID/key as my first field and hidden, and anything else after that.?
 

gakiss2

Registered User.
Local time
Today, 05:12
Joined
Nov 21, 2018
Messages
168
Well it depends on the order of the fields for your combo?, but the index starts at zero.?

I normally have the ID/key as my first field and hidden, and anything else after that.?

Yes, zero column is the 'index', that is what I get with Me.DocStep As I understand this is exactly what you should get with Me.DocStep since the default property is .value and the zero column is what should be returned for .value.

DOH! I was using the field name DocStep when I should have used the CONTROL name which was a very original 'Combo88'.

works now
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:12
Joined
Sep 21, 2011
Messages
14,051
DOH! I was using the field name DocStep when I should have used the CONTROL name which was a very original 'Combo88'.

works now

Don't you just hate it when that happens? ;)

Glad you found the problem. Sometimes the silly ones are the hardest to find.:banghead:
 

Users who are viewing this thread

Top Bottom