[AccessD] Combo box default value

Gustav Brock Gustav at cactus.dk
Wed Oct 10 09:38:04 CDT 2007


Hi Charlotte

I see your point and I myself very seldom use column heads.

A side note: If replacing 0 with Abs(.ColumnHeads) is overkill what is the wording for inserting one code line? Massive overkill!?

/gustav

>>> cfoust at infostatsystems.com 10-10-2007 16:23 >>>
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.





More information about the AccessD mailing list