By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,663 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,663 IT Pros & Developers. It's quick & easy.

Code Help Needed - ItemsSelected

100+
P: 132
I have this code in a list box. I'm trying to determine which PrintButton to display based upon the users selection. When executed I get this error "Argument not optional" Any ideas?

Also, the list box's control source is a query.


If ReportList.ItemsSelected = "By Age (Open Appeals)" Then

PrintBtn1.Visible = True
PrintBtn2.Visible = False
PrintBtn3.Visible = False
PrintBtn4.Visible = False

End If
Jan 25 '08 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
.ItemsSelected takes a Long Integer for an argument, not a string, as you've used, hence the somewhat unclear error message. Assuming that "By Age (Open Appeals)" is one of the items in your listbox, you should be using the .Value property of ReportList. Since this is the Default Property, you don't really need to use it. I think a simple

If ReportList = "By Age (Open Appeals)" Then

will work.

Linq ;0)>
Jan 25 '08 #2

100+
P: 132
.ItemsSelected takes a Long Integer for an argument, not a string, as you've used, hence the somewhat unclear error message. Assuming that "By Age (Open Appeals)" is one of the items in your listbox, you should be using the .Value property of ReportList. Since this is the Default Property, you don't really need to use it. I think a simple

If ReportList = "By Age (Open Appeals)" Then

will work.

Linq ;0)>
Worked like a TOP, Thanks!
Jan 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.