|
-
Nov 7th, 2000, 04:01 PM
#1
Thread Starter
Member
Hi all,
I have a sub which I want to call to fill a combobox. But it doesn't work. Here's the code:
---------------------------
Sub AddListItems(cmbname As ComboBox)
Dim sTemp As String
cmbname.Clear
Open (App.Path & "\list.txt") For Input As #1
While Not EOF(1)
Line Input #1, sTemp
cmbname.AddItem sTemp
Wend
Close #1
End Sub
----------------------------
For example when the combobox I want to fill is named cmbStuff, I would call it AddListItems (cmbStuff)
It should work right? But it doesn't. It gives me type mismatch.
If I replace the line
"Sub AddListItems(cmbname As ComboBox)"
with
"Sub AddListItems"
and change all the "cmbname" with "cmbStuff" in the above code, and call the simply by AddListItems, it works FINE.
Where is my mistake? Thanks in advance for any help.
Martin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|