Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box

Status
Not open for further replies.

DrillMonkey

Technical User
Sep 29, 2006
64
US
Hi forum,

Is there a way to have my combo box display a field name by default "without" user inter action? When the form opens I want to display the field name in the combo box. The field name is school and the table name is Items..
 
Hi
Just off the top of my head........
Set the combo default value to "School".

In your row source, have the values of schools that can be selected and at the top (first in the list), include the default value of "school". Then if the user does not select a school, you will know as the combo will have the value of school in it.

regards

Zollo A+ / VBA Developer
[thumbsup]
 
How are ya DrillMonkey . . .

I don't see any problem here!

Make a query to do what you want, then copy/pste the SQL into the RowSource of the combo!

[blue]Your Thoughts! . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks to both of you for answering, I tried both suggestions with no luck. The closest I have come to making this work is. "Row source type" value list and "Row source" school this does not display the school field by default but comes pretty close.
 
Just to be clear here, I have no problem getting the school field to show in my combo, as long as you pull down the the arrow button, I want the field name "school" to be there without using the drop down arrow button. I want it to be the default value for that control.
 
In the Load event procedure of the form:
Me![combo name] = Me![combo name].Column(0, 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
DrillMonkey . . .

You keep saying [blue]school field [/blue]& [blue]field name[/blue] which to me is the name of the field the combobox is bound too, not a member of the listing!

In any case you set the [blue]Default Value[/blue] of the combo using the [blue]Bound Column[/blue] value (more often the hidden column).

In form design view:
Code:
[blue]   "BoundColumnValue"[/blue]
In VBA:
Code:
[blue]   Me!ComboboxName.DefaultValue = """BoundColumnValue"""[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top