[AccessD] Combo box default value

Charlotte Foust cfoust at infostatsystems.com
Wed Oct 10 09:23:39 CDT 2007


True, and I've used that myself, but it is kind of overkill if the
developer is building one-off code.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, October 10, 2007 1:28 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Combo box default value

Hi Susan and Charlotte

The generic solution to bypass the "unless" is to include the value of
the ColumnHeads property:

    With cboYourCombobox
      .Value = .ItemData(Abs(.ColumnHeads))
    End With

/gustav

>>> ssharkins at gmail.com 10-10-2007 01:41 >>>
That's it -- thank you Charlotte. I knew one of you guys would know it
without looking it up. :)

Susan H.


> The simple express is ItemData(0) unless you have turned on column 
> headings in the dropdown and then it's ItemData(1), since zero is the 
> heading row.
>
>
> The query sorts by most often chosen? That's interesting -- so the 
> most often chosen should be the top item in the combo right? If that's

> the case, you simply set the default value to the first item -- 
> there's a simple expression for doing so that I can't recall off the 
> top of my head -- someone's going to know it --
>
> control.Data(0)
>
> or something like that.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list