By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

how to show different values other than the first in a combo box

P: n/a
currently when I load a new form, i have a combo box that shows the first
item in the list it pulls its data from
the fields are customeridkey and customername

and the code is...
me.customeridkey = me.combo52.itemdata(0)

i would like to know how to pull the last value, is there something that
refers to the last record as opposed to 0 which refers to the first?
I am guessing that there may be a command like strlen that gives me how many
records there are in a table and that would go there but I dont know that
command

and then say I have a specific customer name that is neither the first or
last, how would I go about populating it with that, so for example if
customeridkey = 5, and customername = CUSTOMER5

thnx
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
wanted to clarify that while the customerID=5, it is NOT the 5th record. its
like the 3rd one down. skipped a few numbers for various reasons

thnx
"Steve" <1@2.com> wrote in message
news:5l****************@newsread1.news.atl.earthli nk.net...
currently when I load a new form, i have a combo box that shows the first
item in the list it pulls its data from
the fields are customeridkey and customername

and the code is...
me.customeridkey = me.combo52.itemdata(0)

i would like to know how to pull the last value, is there something that
refers to the last record as opposed to 0 which refers to the first?
I am guessing that there may be a command like strlen that gives me how many records there are in a table and that would go there but I dont know that
command

and then say I have a specific customer name that is neither the first or
last, how would I go about populating it with that, so for example if
customeridkey = 5, and customername = CUSTOMER5

thnx

Nov 13 '05 #2

P: n/a
"Steve" <1@2.com> wrote in message
news:5l****************@newsread1.news.atl.earthli nk.net...
currently when I load a new form, i have a combo box that shows the first
item in the list it pulls its data from
the fields are customeridkey and customername

and the code is...
me.customeridkey = me.combo52.itemdata(0)

i would like to know how to pull the last value, is there something that
refers to the last record as opposed to 0 which refers to the first?


Put in Control Source of your Combo52:
=Combo52.Itemdata(Combo52.ListCount-1)

See Help for Itemdata and ListCount for better
understanding.

Bruno
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.