Default value combobox

martijn

Registered User.
Local time
Today, 19:46
Joined
May 13, 2002
Messages
11
Hello!

I want to set a default value of a combobox ,wich is based on a query, when I load my form. I want to have the first value of the query to set as default.
The query is like this
SELECT Table.Name
FROM Table

Could someone help me with this?

Greetz,
Martijn
 
In the default value, place the following

= Forms!NameofFormWithCombo!NameOfCombo.Itemdata(0)

This will place the first value in the combo.
HTH
 
Hello!

Sorry but it doesn't work? Any other suggestions?

Tanx,

Martijn
 
I think both Table and Name are reserved words in Access so avoid using them (unless you are just giving an example)

in the Form_Load(), place

me.NameofCombo.Value = me.NameofCombo.ItemData(0)

my first answer was incorrect (as you found!)
wink.gif
 

Users who are viewing this thread

Back
Top Bottom