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

combo box display

P: n/a
Is there a way to set up a combo box so that when the user clicks the arrow,
the list is populated with info from a specific field from a table but once
they select an option, data from another field gets displayed in the box? In
other words, when the user selects the drop down list, I want a them to see
a list of full titles for them to select. Once they click on a title,
however, I want an abbreviation to get put into or displayed in the box. So
a record in the table might read:

ID Title Abbreviation
1 A Full Title Is Here Full Title

So, user opens the list box and sees "A Full Title Is Here", they click on
that text and "Full Title" appears in the closed combo box.
Aug 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Jimmy Stewart wrote:
Is there a way to set up a combo box so that when the user clicks the arrow,
the list is populated with info from a specific field from a table but once
they select an option, data from another field gets displayed in the box? In
other words, when the user selects the drop down list, I want a them to see
a list of full titles for them to select. Once they click on a title,
however, I want an abbreviation to get put into or displayed in the box. So
a record in the table might read:

ID Title Abbreviation
1 A Full Title Is Here Full Title

So, user opens the list box and sees "A Full Title Is Here", they click on
that text and "Full Title" appears in the closed combo box.
im a little unclear as to what your trying to do, but i have an idea.
There are several ways you can accomplish this. One way is to add
another field to your table that contains all of the abbreviations, and
then on your form, add a combo box and select the option that says
'Find a record on my form based on the values i select from my combo
box' then go through the wizard and for the combo box values move your
title field into the combo box. Once you finish adding the combo box,
go to the field list on the main access window (View>Field List) and
then drag your 'Abbreviation' field onto the form. Then as you select
items from the drop down list, the abbreviations will appear in the
box.

another way to do this, which will cut down on the amount of data
stored, and it also won't make you go through and enter all the
abbreviations is as follows:

Private Sub Combo1_AfterUpdate()
Dim strCombo as string

strCombo = Me.Combo1

Me.Box1 = Mid(strCombo,3,Len(strCombo)-10)
End Sub

This will do the trick, however it only works if the extra words are
always teh same in the title. (i.e. The words getting trimmed off are
always 'A' and 'Is Here') Because of this, i would recommend the first
way, with entering the specific fields in the table.

Aug 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.