Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox.Clear unspecified error

Status
Not open for further replies.

Westicle

Programmer
Aug 22, 2002
29
0
0
GB
I have a combobox on a userform that is populated according to the code below

The user then makes adjusments to certain entries - the code is then re-run to produce a new list with the corrected entry removed. To do this I use the following:

AnalCodesUserForm.JobNumberComboBox.Clear

When the code re-runs though, the code breaks and I get the unspecified error message and it highlights the above line?

Case "None"
x = -1
For z = 1 To JobCount
If Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "None" _
Or Application.WorksheetFunction.VLookup(JobArray(z, 1), JobSource, 16, False) = "Part" Then
x = x + 1
AnalCodesUF.JobNumberCB.AddItem JobArray(z, 1)
AnalCodesUF.JobNumberCB.List(x, 1) = JobArray(z, 2)
Else
End If
Next
End Select

Has anyone seen something like this before? I couldn't find much about combobox.clear questions.
 
woops my mistake.

AnalCodesUserForm.JobNumberComboBox.Clear - this should be

AnalCodesUF.JobNumberCB.Clear

Interesting links.





 
what do you mean by "unspecified error" - does it physically say "Unspecified error" ?? is there an error number ??

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
The Clear method don't work if the RowSource property is set.
In which event procedure are you running the code twice ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Goeff - yeah it says:

Run Time Error - -2147467259(80004005)
Unspecified error

PH

the first time the procedure is called by a button the user clicks to open the form, the second time it's called when they click a button to submit any changes they've made.

The RowSource isn't set because the ComboBox is filled by the code above. i.e from an array.
 
PH your right - i added this and it sorted it

AnalCodesUF.JobNumberCB.RowSource = ""

Thanks for your help guys.

Westy.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top