G
gatarossi
Dear all,
In my form there is a multiselect listbox. Inside this listbox there
are some dates, for example: 01/01/07, 01/02/07, 01/03/07, 01/04/07...
I made a code that consist: each time that I select one date in my
multiselect listbox, in my subform appear one textbox. The problem is:
In my subform there are only 12 textbox and in the multiselect listbox
can exist more than 12 dates, and the code below in not flexible,
because I only can use the first twelve dates from the sequence of
dates in the multiselect listbox; and I would like that it pick the
first 12 dates that the user selected.
For example:
Multiselect Listbox - Dates
01/01/07
01/02/07
..
..
..
In the code below, if I click in 01/01/07 it will appear the textbox1,
if I click in 01/02/07 it will appear the textbox2.
But If I only click in 01/02/07, I would like that appear the
textbox1, not the textbox2.
This is the code:
Private Sub lstdata_Click()
If lstdata.Selected(0) = True Then
Me!despesas_subform!txtp1.ColumnHidden = False
Else
Me!despesas_subform!txtp1.ColumnHidden = True
End If
If lstdata.Selected(1) = True Then
Me!despesas_subform!txtp2.ColumnHidden = False
Else
Me!despesas_subform!txtp2.ColumnHidden = True
End If
If lstdata.Selected(2) = True Then
Me!despesas_subform!txtp3.ColumnHidden = False
Else
Me!despesas_subform!txtp3.ColumnHidden = True
End If
..
..
..
End Sub
Thanks!
André.
In my form there is a multiselect listbox. Inside this listbox there
are some dates, for example: 01/01/07, 01/02/07, 01/03/07, 01/04/07...
I made a code that consist: each time that I select one date in my
multiselect listbox, in my subform appear one textbox. The problem is:
In my subform there are only 12 textbox and in the multiselect listbox
can exist more than 12 dates, and the code below in not flexible,
because I only can use the first twelve dates from the sequence of
dates in the multiselect listbox; and I would like that it pick the
first 12 dates that the user selected.
For example:
Multiselect Listbox - Dates
01/01/07
01/02/07
..
..
..
In the code below, if I click in 01/01/07 it will appear the textbox1,
if I click in 01/02/07 it will appear the textbox2.
But If I only click in 01/02/07, I would like that appear the
textbox1, not the textbox2.
This is the code:
Private Sub lstdata_Click()
If lstdata.Selected(0) = True Then
Me!despesas_subform!txtp1.ColumnHidden = False
Else
Me!despesas_subform!txtp1.ColumnHidden = True
End If
If lstdata.Selected(1) = True Then
Me!despesas_subform!txtp2.ColumnHidden = False
Else
Me!despesas_subform!txtp2.ColumnHidden = True
End If
If lstdata.Selected(2) = True Then
Me!despesas_subform!txtp3.ColumnHidden = False
Else
Me!despesas_subform!txtp3.ColumnHidden = True
End If
..
..
..
End Sub
Thanks!
André.