|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error Trapping QuestionHi,
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 "jake" <j*@broncos.com> wrote in message Maybe it's just me, but little of that made sense.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? 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 "jake" <j*@broncos.com> wrote in message I would suggest that you're approaching this the wrong way.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. 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 Again, a good reason for writing a "wrapper" routine - if you have> some of the data in a combobox which makes old files for this app > not compatible. "mappings" between old and new values, this routine can apply them, eliminating the incompatiblity. HTH, Phill W.
Other interesting topics
|
|||||||||||||||||||||||