Use value of combo box column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box with three columns.

I want an If statement to execute on the value of the contents of column 3
which contains text C or D.

How can I do this? I've tried

If Me.MyCombo.Column(3)="D" then
TakeSomeAction
Elseif
Me.MyCombo.Column(3)="C" then
DosomethingElse
end if

Thanks
 
Hi,

The Column property is zero based so the third column should equate to:

Me.MyCombo.Column(2)

HTH

Mark.
 
Thanks - yes I was counting from 1 not 0.

Roger Carlson said:
Combo box columns are indexed starting at zero, so the column numbers for a
3 column combo are 0, 1, 2. Try using 2.

BTW, the condition must be on the same line as the ElseIf:

ElseIf Me.MyCombo.Column(2)="C" then

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top