Re: Default combobox line
- From: "Rod Speed" <rod_speed@xxxxxxxxx>
- Date: Thu, 8 Sep 2005 07:07:09 +1000
Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
> Are you saying it does not work with the Dlookup
> in the Default Value property of the combo box?
No, that works fine and is the best way to do it.
I didnt register that that was what you meant by
not doing it in an event.
The only problem with doing it from code was that you
need an = on the front of what is written to the default
value property for some reason, even tho you dont if
you put a fixed string in the default value property manually.
> "Rod Speed" wrote:
>
>> Rod Speed <rod_speed@xxxxxxxxx> wrote:
>>> Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>
>>>> 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.
>>
>> What does work is to set the Default Value to
>> =[Drive].[ItemData](1)
>> when you want the second item in the list to be the default value
>>
>> Not at all clear why I cant set it from visual basic tho.
>>
>>
>>>> Rod Speed wrote
>>>>> Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> 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.
>>>>>
>>>>>
>>>>>> "Rod Speed" wrote:
>>>>>>
>>>>>>> Larry Linson <bouncer@xxxxxxxxxxxxx> wrote
>>>>>>>
>>>>>>>> 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.
>>>>>>>
>>>>>>>
>>>>>>>> "Rod Speed" <rod_speed@xxxxxxxxx> wrote in message
>>>>>>>> news:e%23BHgN2sFHA.2540@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>> 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 ?
.
- References:
- Default combobox line
- From: Rod Speed
- Re: Default combobox line
- From: Larry Linson
- Re: Default combobox line
- From: Rod Speed
- Re: Default combobox line
- From: Klatuu
- Re: Default combobox line
- From: Rod Speed
- Re: Default combobox line
- From: Klatuu
- Re: Default combobox line
- From: Rod Speed
- Re: Default combobox line
- From: Rod Speed
- Re: Default combobox line
- From: Klatuu
- Default combobox line
- Prev by Date: Make a combobox a search tool...
- Next by Date: Re: Forced Entry into a form field
- Previous by thread: Re: Default combobox line
- Next by thread: how to create a username and password for form
- Index(es):
Relevant Pages
|