Auto select

  • Thread starter Thread starter arm
  • Start date Start date
A

arm

Hi! Could anyone please help me. I have this subform that is link to a
list box (on a main form) which only shows the record I want only when an
item has been selected from the list box. What I would like to happen when
the main form opens I would like to immediately display the related record
on the subform base on the first item on list box without having to select
that item. Thank you. :-)
 
Refer to the first item in the list as the default value of the ListBox...

= [Forms]![frmNames]![lstNames].[ItemData](3)

on a Form called "frmNames", the ListBox "lstNames" has the fourth item in
the list selected when the form opens. I copied this directly from an
example database I have.

It works as well for ComboBoxes... I often use those rather than List Boxes
because they take up less Form "real estate".

Larry Linson
Microsoft Access MVP
 
I have a problem with my default property. I've tried a ton of ways
including this:

=[Forms]![F_COA_ASSIGNMENTS_2]![Selected_Ship_to_List].[ItemData](6)

But regardless of what I enter on the default property line, my 5th line is
not selected. No lines are selected in fact.

Any ideas why?

Craig

Larry Linson said:
Refer to the first item in the list as the default value of the ListBox...

= [Forms]![frmNames]![lstNames].[ItemData](3)

on a Form called "frmNames", the ListBox "lstNames" has the fourth item in
the list selected when the form opens. I copied this directly from an
example database I have.

It works as well for ComboBoxes... I often use those rather than List Boxes
because they take up less Form "real estate".

Larry Linson
Microsoft Access MVP

arm said:
Hi! Could anyone please help me. I have this subform that is link to a
list box (on a main form) which only shows the record I want only when an
item has been selected from the list box. What I would like to happen when
the main form opens I would like to immediately display the related record
on the subform base on the first item on list box without having to select
that item. Thank you. :-)
 
Back
Top