Re: Setting a ListBox value Programmatically?
From: Gary Schuldt (garyschuldt_at_comcast.net)
Date: 02/19/04
- Next message: Stephen Lebans: "Re: stacked tiff image"
- Previous message: Stephen Lebans: "Re: Access newbie picture question"
- In reply to: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Next in thread: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Reply: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Feb 2004 13:34:29 -0800
Thanks, Kelvin. I now am clear that it's the bound column that controls the
display.
The listboxControl's row source is a query:
SELECT tForm.FormID, tForm.FormName, tForm.DisplayFormName FROM tForm
The bound column is 1, displayed is 2
So if I execute the statement
Me.lstboxControl.Column(0) = 7
from somehwhere else in the main form code, what actually is happening
behind the scenes of the form? Does the current record in tForm become the
one whose ID = 7 and then lstboxControl is populated with that row, so that
Column(1) contains tForm.FormName and that's what is displayed and
highlighted?
That's definitely what I want the result to be!
Gary
"Kelvin" <klu@klu.com> wrote in message
news:eslDgDy9DHA.1948@TK2MSFTNGP12.phx.gbl...
> Combo boxes and list boxes are all controlled by the bound column
regardless
> of what data is shown. So if you want to set the selected item in the
list,
> set the value of the list to the value of the bound column. In your case
it
> would be the ID.
>
> Kelvin
>
> "Gary Schuldt" <garyschuldt@comcast.net> wrote in message
> news:uRhNonx9DHA.488@TK2MSFTNGP12.phx.gbl...
> > I have a lstboxControl based on the first 3 columns of a table tForm.
The
> > listbox displays only the 2nd column (the name; the ID is the first
> column).
> >
> > Normally the user clicks on the desired value. However, there's a
> situation
> > in which I can logically determine the proper value from some other
coding
> > in the form (CBF).
> >
> > Is it possible to set the value for the lstboxControl in that way?
Which
> > Column value do I set . . . the ID, or the one that's displayed? I
don't
> > have a good sense for what to do here.
> >
> > Thanks for the help, as always.
> >
> > Gary
> >
> >
>
>
- Next message: Stephen Lebans: "Re: stacked tiff image"
- Previous message: Stephen Lebans: "Re: Access newbie picture question"
- In reply to: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Next in thread: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Reply: Kelvin: "Re: Setting a ListBox value Programmatically?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|