R
Randall Arnold
I have a weird one. I have an Address List control (on main form) that
pulls up a list of street addresses and job numbers (column 0 and 1, resp)
from a table. Toggle buttons below the list pull up either a scheduling
form or an editing form in a subform depending on value. By default
everything loads just fine. However, if the first address is selected when
the main form loads (schedule mode), and I then click to edit mode, I get a
syntax error in my VB code that is designed to cause the edit subform to
jump to the selected record (in this case the first, or default, address).
Debugging showed me that the Listindex property is reported as -1 when it
should be 0. In fact, VB Help indicates 0 is the starting ordinal! There
should be no -1 value.
Note that this error does not come up if I select another address prior to
changing subforms... even if I move back to the original default record that
caused the error!
I have the column heads selected; does that affect the listindex? And if
so, why does the Listindex return the proper default value (0) when the main
form and default subform load, but the wrong value (-1) when I load a new
subform? Makes no sense.
Randall Arnold
pulls up a list of street addresses and job numbers (column 0 and 1, resp)
from a table. Toggle buttons below the list pull up either a scheduling
form or an editing form in a subform depending on value. By default
everything loads just fine. However, if the first address is selected when
the main form loads (schedule mode), and I then click to edit mode, I get a
syntax error in my VB code that is designed to cause the edit subform to
jump to the selected record (in this case the first, or default, address).
Debugging showed me that the Listindex property is reported as -1 when it
should be 0. In fact, VB Help indicates 0 is the starting ordinal! There
should be no -1 value.
Note that this error does not come up if I select another address prior to
changing subforms... even if I move back to the original default record that
caused the error!
I have the column heads selected; does that affect the listindex? And if
so, why does the Listindex return the proper default value (0) when the main
form and default subform load, but the wrong value (-1) when I load a new
subform? Makes no sense.
Randall Arnold