Default Value ComboBox with SQL RowSource

  • Thread starter Thread starter darien.watkins
  • Start date Start date
D

darien.watkins

I've been searching through the groups for ways to solve this, but I'm
not getting it somehow.

I have a combobox with an SQL rowsource and what I want to do it set
the default value to the first item in the rowsource. Nothing I do
seems to help.

I've tried :
=Me!lstTerminal.ItemData(0) in the default property
=Me.lstTerminal.ItemData(0) in the default property

I've tried placing Me.lstTerminal.DefaultValue =
Me.lstTerminal.ItemData(0) as a form property for GotFocus.

I'm out of ideas, whenever i bring up my form, it's blank until I
select :(

Any thoughts?

Darien
 
Yeah I think that you'd need to set that in an event, not in the
rowsource or default



if you had a function that was = to Me.lstTerminal.ItemData(0) then
you should be able to bind to that VBA function
 
I posted an answer to this; and it was a real constructive answer

but MS blocked it ;)

sorry
 
It sounds like you aren't firing the thing. It won't "return" a value
until you do. Of course you can set that value from form events such
as Load or Current: Me!MyCbo="......"

HTH
 
On that note what is the best trigger to fire an event? If I had a
form that opened another form, then came back... would the current
trigger be able to take care of that? I imagine load would only work
for the initial opening.

Darien
 
The best trigger to fire an event will be the one that produces the
results you want without producing disastrous side effects.

You posted a very limited issue. Every solution to that issue will
work in some circumstances and not in others. It's up to you to take
the ideas you get here and to try them and adapt them to your needs.

Sometimes you get lucky and the proposed solution fits your issue like
a glove. Other times, not so much.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top