|
-
Jan 17th, 2008, 08:10 PM
#1
Thread Starter
New Member
[RESOLVED] argument not optional
i think this one might be really easy for more experienced people, but it has me stumped.
I try to add an item to a listbox (list1) using list1.additem
whenever I go to the sub (before it goes through it) it breaks and says "argument not optional"
Code:
Private Sub Calendar1_Click()
'some other file opening code
For i = 1 To datefilelength
List1.AddItem = events(i).appointments
Next i
End Sub
-
Jan 17th, 2008, 08:25 PM
#2
Re: argument not optional
Me being not so clever is unsure what events(i).appointments actually is, but i assume it's not a string.
Is it a UDT or Class? If so can you post the code that defines it.
-
Jan 17th, 2008, 08:27 PM
#3
Thread Starter
New Member
Re: argument not optional
 Originally Posted by Milk
Me being not so clever is unsure what events(i).appointments actually is, but i assume it's not a string.
Is it a UDT or Class? If so can you post the code that defines it.
actually it is a string
Private Type appointment
appointments As String * 60
End Type
Dim events() As appointment
it can probably be a lot simpler, however i just dont know how
-
Jan 17th, 2008, 08:38 PM
#4
Re: argument not optional
Code:
For i = 1 To datefilelength
Call List1.AddItem(events(i).appointments)
Next i
-
Jan 17th, 2008, 08:43 PM
#5
Re: argument not optional
oops
Code:
List1.AddItem = events(i).appointments
'should be
List1.AddItem events(i).appointments
...but, I can't see the reason of
Code:
Private Type appointment
appointments As String * 60
End Type
Dim events() As appointment
over
Code:
Dim appointments() as String * 60
I assume theres a good reason.
edit: I see I've been beaten to it
Last edited by Milk; Jan 17th, 2008 at 08:47 PM.
Reason: because I can't spell
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
|