Klatuu said:
As to entering it twice, there is not much you can do about that.
I do like the idea of having a field in the table that identifies
the defalut choice. I would not suggest using an event to set it.
Instead, I think you might use a DLookUp in the default value to do
that for your: =DLookUp("[TheField]","MyTableName","[DEFAULT_ITEM] =
True")
Where [TheField] is the bound field for the combo box you want to be
the default value and [DEFAULT_ITEM] is the field you mentioned that
will tell you which is the default selection. You will need to
change the names to protect the innocent.
Yeah, that's what I meant, with that
control.DefaultValue=dlookup(etc)
in the OnOpen event for the form.
This is an untested idea, but if it works, it
would be a cool way to do it. (I think it will)
It doesnt currently for some reason, likely just a brain fart on my
part tho. Although the control.DefaultValue string is correct, for
some reason it doesnt end up in the control property.
Rod Speed wrote
Klatuu <
[email protected]> wrote
I think you are on the right track. If it will always be the same
item in the list, regardless of position, then use the Default
Value property of the combo box.
I dont really mind if the default value moves around in the list as
other items are added, I just want to have one particular item as
the default.
My initial superficial reaction to the use of the default property
was that that item has to be entered twice, once as an item in the
table
that contains the items, once in the default property. That isnt
hard to fix with another field in the table that flags which item
is the default and the OnOpen or OnLoad Event can just get that
item and put it
into the default property of the control.
:
If you don't want it to be the first item in the list, what _do_
you want it to be?
One of the other items that I specify.
Looks like the default value of that control is
what I need from another post elsewhere.
OK, I've got a form that works fine with the user selecting a
combobox entry that is required manually.
I want to set the default when the form is opened so you only
need to do that if the default isnt what you want.
I dont want it to be the first item in the list, tho that would
be a viable kludge.
How do I do that ?