Re: Default value in a combo box

Tech-Archive recommends: Speed Up your PC by fixing your registry



Combo boxes are used on a form... so I'm confused by your description of
"not using user forms but in a standard combo box"?

More information, please.
--

Ken Snell
<MS ACCESS MVP>


"jwh" <jwh@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A3B0C601-7754-423D-B49B-9A7531E19164@xxxxxxxxxxxxxxxx
> What if you were not using user forms but a standard combo box. I have a
> combo box that puts the value of the "list" in a cell that the cursor was
> in
> when I double click it. But I would like to have a default value - any
> suggestions.
>
> "Ken Snell [MVP]" wrote:
>
>> Is SourceID the name of the combo box? It shouldn't be, but if it is, use
>> this:
>>
>> Me!SourceID.Value = Me!SourceID.ItemData0)
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>> "Dan" <Dan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:88E5880F-0166-4790-9EBF-A9DA8AA23014@xxxxxxxxxxxxxxxx
>> > Ken:
>> > I tried:
>> > Private Sub Form_Load()
>> >> Me.SourceID.Value = Me.SourceID.ItemData(0)
>> >> End Sub
>> >
>> > Doesn't work. Data is in table tblSource with 2 fields: SourceID and
>> > Source.
>> > Combo looks at this table. Did I misinterpret your suggestion?
>> > Thanks,
>> > Dan
>> >
>> > "Ken Snell [MVP]" wrote:
>> >
>> >> You'll need to run code that sets the combo box value to the desired
>> >> value.
>> >> If you want this to occur when the form opens, you could use the
>> >> form's
>> >> Load
>> >> event to do this. In the example below, I'm setting the combo box to
>> >> the
>> >> first item in its list:
>> >>
>> >> Private Sub Form_Load()
>> >> Me.ComboBoxName.Value = Me.ComboBox.ItemData(0)
>> >> End Sub
>> >>
>> >> --
>> >>
>> >> Ken Snell
>> >> <MS ACCESS MVP>
>> >>
>> >>
>> >>
>> >> "Dan" <Dan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:4CFC3003-B1A0-4E14-8599-57642AF6651D@xxxxxxxxxxxxxxxx
>> >> >I have a form with a combo box listing a series of values. Instead of
>> >> >a
>> >> > NotInList routine, I would like to have a default value appear in
>> >> > the
>> >> > combo
>> >> > box when a new form is opened so that the user can tab to the combo
>> >> > box
>> >> > and
>> >> > either accept the default value or pull down the list to select a
>> >> > different
>> >> > value. Any help appreciated.
>> >> > Thanks,
>> >> > Dan
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: Default value in a combo box
    ... What if you were not using user forms but a standard combo box. ... combo box that puts the value of the "list" in a cell that the cursor was in ... > Is SourceID the name of the combo box? ... >> Private Sub Form_Load ...
    (microsoft.public.access.forms)
  • Re: focus group question for new products
    ... It seems to me that I should basically have a standard design with ... OTOH you will be milling away 99% of the original block and you truly ... I think you've got to concentrate on quick-turnaround custom stuff. ... And think about doing more than just boxes (although ...
    (rec.radio.amateur.homebrew)
  • Re: Alternative for load balancing/high availability while ISA 2004 Enterprise is not released
    ... > For that reason I am buying two boxes dedicated for ISA. ... > balance method. ... > b) Is it possible to setup two ISA 2004 Standard and do a DNS Round Robin ...
    (microsoft.public.isa)
  • Re: Software update on SKY+ pace V1 boxes- Public relations farce!
    ... standard 20gig old standard drive. ... The people who own the boxes can indeed do what they wish with them, ... If sky hadn't fixed this software they would have been liable to replace all ... the V1 boxes they "broke" with software they imposed without customers being ...
    (uk.media.tv.sky)
  • Re: TV and built in Freesat?
    ... has resulted in various boxes, some of which fail to comply with the UK ... additions to the standard. ... UK now to simply broadcast satellite services, ... Isn't this the same level of control as "Freeview"? ...
    (uk.tech.digital-tv)