Full Version: Default in a combobox
UtterAccess Forums > Microsoft® Access > Access Forms
swaziman1
HI,
I have a combobox with a list of data, in the properties of the combobox i set the default
to "Europe" (its a list of continents) , how can i get it to go to the default when the form is opened?
thanks
jmcwk
If your Continents Table has a Primary Key Identifuing each continent use

Me.YourComboName.DefaultValue=1

Where 1 Represents the Primary Key for Europe

Try placing that in the On Open Event of the Form

Or

me.YourComboName = 1


Edited by: jmcwk on Thu Aug 16 10:51:56 EDT 2007.
swaziman1
the data source for my combobox is a query
jmcwk
Why not the Continents Table ?
swaziman1
it has a second column which is a calculated field
jmcwk
Swazi,
You lost me there, what does a Calculated Value have to do with the record Source of the Combo Box The Continents Table? And what does the Calculated Value have to do with wanting to set the Default To Europe? The Continents table I would think would be a Look Up Table of your Continents Table. Just exactly what is it you are trying to achieve? And I also assume that your calculated value is not being stored at the Table Level.
Not seeing you Structure hard for me to say ????
jmcwk
Can you attach a zipped copy of your DB no larger than 500kb and no sensitive data?
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.