first and last record

  • Thread starter Thread starter Anna Tolstoj
  • Start date Start date
A

Anna Tolstoj

Hi,

I have a form with option buttons and combo boxes.

After the user has chosen an option, I set the rowsource for the combo boxes
by using the After Update event of the option.

Now, after selecting one particular option I want to set the rowsource for
the combo box to the first record in the rowsource (which happens to be a
table), and the other combo box to display the last record in the rowsource.

Is there a way to do this?

Thanks,

Anna
 
-----Original Message-----
Hi,

I have a form with option buttons and combo boxes.

After the user has chosen an option, I set the rowsource for the combo boxes
by using the After Update event of the option.

Now, after selecting one particular option I want to set the rowsource for
the combo box to the first record in the rowsource (which happens to be a
table), and the other combo box to display the last record in the rowsource.

Is there a way to do this?

Thanks,

Anna
Hi Anna,

use the following as an example.
with myCombo
' first row has index of 0
..value=.itemdata(0)
end with

with myCombo
' last row is count less 1
..value=.itemdata(.listcount - 1)
end with

luck
Jonathan
 
Works great.

Thanks!


Jonathan said:
Hi Anna,

use the following as an example.
with myCombo
' first row has index of 0
.value=.itemdata(0)
end with

with myCombo
' last row is count less 1
.value=.itemdata(.listcount - 1)
end with

luck
Jonathan
 
Back
Top