Home All Groups Group Topic Archive Search About

Error Trapping Question

Author
18 Oct 2005 9:10 PM
jake
Hi,

I trap an error 383 for all of my comboboxes when I try to pick an item in
the combobox (cboFluid = strFluidName) that does not exists.  Is there a way
to find out which combobox fired that error?  The reason I need to know this
is in my new app I have changed some of the data in a combobox which makes
old files for this app not compatible.  I was thinking that maybe the better
way is to filter the file coming before loading the data and modifying it.
Any ideas?

Thanks

Author
18 Oct 2005 11:24 PM
MikeD
"jake" <j*@broncos.com> wrote in message
news:%23ViGEkC1FHA.164@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I trap an error 383 for all of my comboboxes when I try to pick an item in
> the combobox (cboFluid = strFluidName) that does not exists.  Is there a
> way to find out which combobox fired that error?  The reason I need to
> know this is in my new app I have changed some of the data in a combobox
> which makes old files for this app not compatible.  I was thinking that
> maybe the better way is to filter the file coming before loading the data
> and modifying it. Any ideas?


Maybe it's just me, but little of that made sense.

Error number 383 is "Set not supported (read-only property)".  If
encountered during runtime for a combobox, the description is "Text property
is read-only", but the error number is the same.  Apparently, your combobox
has a Style property set to 2 - Dropdown List.

If it were me, I'd make sure any changes are compatible with these older
versions of files. You didn't explain a lot (anything really) about these
"old files", but do you really want all users to have this "problem" when
they upgrade to a new version of your app? Apparently, you do realize this
and that's why you want to "filter the file".

But no, I know of no way to determine which combobox *raises* the error
(errors are raised, events are fired).  You should be able to determine it
from your code though....even at runtime via the Name property.

I suggest you post your code so we can see exactly what you're doing.

--
Mike
Microsoft MVP Visual Basic
Are all your drivers up to date? click for free checkup

Author
19 Oct 2005 11:29 AM
Phill. W
"jake" <j*@broncos.com> wrote in message
news:%23ViGEkC1FHA.164@TK2MSFTNGP10.phx.gbl...

> I trap an error 383 for all of my comboboxes when I try to pick
> an item in the combobox (cboFluid = strFluidName) that does not
> exists.

I would suggest that you're approaching this the wrong way.

If you are using a "DropDown" list, you /cannot/ assign to the
Text property - it's readonly - so you shouldn't even be trying to!

Write a routine that will loop through (or use API calls) to find
the value you've supplied and select it by setting the ListItem
property.

> The reason I need to know this is in my new app I have changed
> some of the data in a combobox which makes old files for this app
> not compatible.

Again, a good reason for writing a "wrapper" routine - if you have
"mappings" between old and new values, this routine can apply
them, eliminating the incompatiblity.

HTH,
    Phill  W.

Bookmark and Share