Help debug source of "Invalid Parameter Value"

bagboy

New Member
Joined
Mar 22, 2006
Messages
27
I have a form with several combo boxes. Each of the combo boxes .RowSource property can change depending upon option button selections.

I am getting the error message, "Invalid Parameter Value" sometimes (and only sometimes - I'm having a terrible time reliably reproducing the error). The error message does not give me enough info to debug; it only says "Invalid Parameter Value" and has an "OK" button.

Could someone please provide suggestions as to how to generate some kind of more informative error message?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi,

difficult to tell from here
is this error 380 ?
reproduce this way
insert new userform
with listbox & textbox (accept default names)
code
Code:
Private Sub TextBox1_Change()
ListBox1.RowSource = TextBox1.Value
End Sub
start using function key F5
change textbox: you will get an error: is it the same error ?

it would be good to display your code
only relevant portion please

kind regards,
Erik
 
Upvote 0
No, it isn't the same error - I wish it was. The message box I'm getting does not have a "debug" button; this is why I don't know which combo box is generating the error.

The message box that is coming up says only "Invalid Property Value" and has only one button: OK. Clicking the OK button dismisses the message box, but clicking anywhere on the form brings it back. The only thing that can be done is close the form and reopen.

I'd post code, but I don't know what the relevant code is. My form uses multipage controls, and the code for the multipage where this occurs is nearly 15,000 characters, involving four ComboBoxes and four OptionButton groups.

Any suggestion for narrowing down the problem?
 
Upvote 0
15.000 characters
didn't you create the code ?
Any suggestion for narrowing down the problem?
you must know when it bugs: what buttons do you click or boxes do you change when it occurs ?disable some procedures like this
Code:
Private Sub ComboBox1_change()
MsgBox "This is Private Sub ComboBox1_change"
Exit Sub
'other existing code
End Sub
admitted you haven't told us much specific yet, so it's difficult to help
 
Upvote 0
Figured it out.

I created a textbox, inserted this code into the Change events for the various elements:
Code:
TextBox1.Value = TextBox1.Value & "cmb1: " & cmb1.RowSource & ", " & cmb1.Value & ", " & cmb1.MatchRequired & ", cmb2: " & cmb2.RowSource & ", " & cmb2.Value & ", " & cmb2.MatchRequired & " cmb3: " & cmb3.RowSource & ", " & cmb3.Value & ", " & cmb3.MatchRequired & "ZZZ"

I found that I didn't set MatchRequired = False when one of the combo boxes .Value was set to "N/A".

It was very strange, though, as it didn't seem to happen consistently. Seems to have been fixed now, though.

And yes, I did write it all myself - but its FAR more complicated a project than I've ever done in VB before.
[/code]
 
Upvote 0
FINE you got it sorted

debugging can be difficult if you've got a lot of code ...
if you find yourself repeating code for different controls, you might consider a classmodule: a bit studying but very interesting to avoid repetitions


can't remember if those links explain what I'm talking about: classmodule can be used for different purposes
http://groups.google.com/group/micr..._frm/thread/fb2a0cb8cdad568e/74c5fb2778c250e1
http://www.tushar-mehta.com/excel/vba/vba_oops_eg1.htm

Chip Pearsons site (www.cpearson.com) is usually a goo d place to stop for these types of tips - and he didn't disappoint this time:
http://www.cpearson.com/excel/ClassModules.htm

There's an overview of class modules in the Excel Experts E-letter (from June 2000, but still relevant):
http://www.j-walk.com/ss/excel/eee/eee019.txt

For plenty of examples, try John Walkenbach's site, and enter class in the Search box:
http://www.j-walk.com/ss/

but feel free to email for an example
subject "classmodule userform"

best regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,203,727
Messages
6,056,991
Members
444,902
Latest member
ExerciseInFutility

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top