473,320 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Have a combo box list Field captions

Heya guys. Might be a simple question, but for the life of me I couldn't hit the right search string in google and find what I'm looking for, so I guess I'll bother all of you instead :p

Alright, the thing is I'd like to create a combo box who's got a table as a source for its Field List. So far so good - the drop-down options are showing up as "fldName", "fldAddress", etc, cuz I'm a good little boy and set my db up with a naming convention and everything.

However, I'd rather the options showed up as their captions, so instead of a list full of "fldXXXX"'s, I'd have something like "Name", "Address" etc, which are the field Captions in the table itself.

Is this doable either using VBA or a SELECT statement in the combo box's "Row Source" field? If the former, be aware I'm a total retard when it comes to coding so please be gentle...

Thanks in advance!
Feb 16 '10 #1
3 4002
ADezii
8,834 Expert 8TB
It sounds like you have the Row Source Type of the Combo Box set to Field List, while it needs to be set to Table/Query.
Feb 17 '10 #2
Hi ADezii , thanks for the reply.

Hmm I tried that...no luck though, sorry. The list is then populated with all the values of those particular fields (Joe;Steve;etc) what I have in mind is more like a list of all the fields themselves (Name/Age/Address/etc) instead of the field names (fldName/fldAge/fldAddress...)

For reference I'm using it as a part of a filter...the user selects the field he wants on the first combo box, then enters the text he wants to match on a related text box.
Feb 17 '10 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi. When a combo box is populated from a table/query it takes its column headings from the field names in the table/query. In checking the properties of a combo box I have not found any way so far in which this can be overridden.

The simplest solution is to change the rowsource of the combo from the table itself to a query on that table. In that query you can alias the fieldnames to be whatever you want:

Expand|Select|Wrap|Line Numbers
  1. SELECT fldName as Name, fldAge as Age, fldAddress as Address, ...,
  2. FROM tblYourTableName ... etc
Although it would also be possible to create a Querydef on the fly in VBA code to do this the work involved is not worth the effort on a use-once basis. Manually defining a simple one-off query - which you can do directly from the combo's rowsource property in edit mode - will do the job just as well and with much less effort.

-Stewart
Feb 17 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: G.Gerard | last post by:
Hello Does anyone know how to get an entire memo field to be displayed in a combo box drop down list? Example - if the memo field contains the following : This is a test to see if
5
by: Filips Benoit | last post by:
Dear all, How can i populate a combo with the field-caption-names of 1 table? Thanks Filip
2
by: Robert | last post by:
Am using a nested continuous bound subform to add multiple records to the underlying table. One of the fields is based on a limit to list combo box. Any suggestions on best way to progressively...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
7
by: Erich Kohl | last post by:
Okay, here's the deal: Let's say a form is based on a table. This form has Field1 (PrimeKey), Field2, Field3, etc. This form also has a subform which shows related records in another table....
1
by: Jimmy Stewart | last post by:
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...
1
by: Nestor01 | last post by:
I use a lookup table which contacts 2 fields (item#, name) When a customer places an order, the order form contains a drop down to select the item by name (from the lookup table). The detail is...
3
rhitam30111985
by: rhitam30111985 | last post by:
Hi all.. i am trying to create a combo with the pop down list being modfied in real time as i type each character : import gtk window=gtk.Window(gtk.WINDOW_TOPLEVEL)...
4
by: Wayne | last post by:
I've used a data field as the rowsource for a combo box many times. The main advantage that I see is that a separate table of say, "Customers" does not have to be constantly updated. When a new...
1
by: nyc10011 | last post by:
I am trying to figure out how to remove a dynamic text field from the stage that plays captions over an .flv from an XML file. I would like to find out how to remove the field before a second .flv...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.