Error 5 'selecteddates' is not a member of 'System.Windows.Forms

Hi Experts

I keep getting the following error on this code. Please help

   If Me.CboSignDates.Text = "btwn" Then
                    If Me.Calendar1.selecteddates.count < 1 And Me.Calendar2.selecteddates.count < 1 Then
                        Me.LblError.Text = "please make a selection from both calendars!"
                        Exit Sub
                    End If
                    ssql = "select * from performance where [date] >= '" & Me.Calendar1.selecteddates & "' and [date] <= '" & Me.Calendar2.selecteddate & "'"
               Else
                    If Me.Calendar1.selecteddates.count < 1 Then
                        Me.LblError.Text = "please make a selection from the first calendar!"
                       Exit Sub
                   End If
                    ssql = "select * from performance where [date]" & Me.CboSignDates.Text & "'" & Me.Calendar1.selecteddate & "'"
                End If

Open in new window


Error      5      'selecteddates' is not a member of 'System.Windows.Forms.MonthCalendar'.      C:\Users\Graham\Dropbox\LIMS_Dev\LIMS1\FrmPerformanceEditor.vb      51      24      LIMS1
GrahamSAAsked:
Who is Participating?
 
YZlatCommented:
Windows form calendar control does not have SelectedDates method, only Web Forms
0
 
GrahamSAAuthor Commented:
Hi Friend
I figured as much, the original code for this is off my companies website.
How would I ammend this code to run?
0
 
YZlatCommented:
What type of control is Calendar1?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
YZlatCommented:
and are you using Windows application or Web application?
0
 
YZlatCommented:
disregard the first question. Duh:0
0
 
GrahamSAAuthor Commented:
:)
I am trying to reproduce a Web application in Windows Forms.
I have the web project files which were left by the companies Developer.

very new to all this but will no doubt get it right...
0
 
YZlatCommented:
If you are using Windows application, you can't really select multiple dates with MonthlyCalendar control
0
 
GrahamSAAuthor Commented:
Check this out, this is an explanation of what I am trying to do. Before I got the code from our developer.

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL_Server_2008/Q_27823785.html

Here is the web form which works perfectly.
http://imslesedi.co.za/Editing.aspx
0
 
CodeCruiserCommented:
There are selectionstart and selectionend properties on this control.
0
 
GrahamSAAuthor Commented:
Cool that sounds like a plan,
How to find or use them and Ill have a go
0
 
CodeCruiserCommented:
As I suggested in your other question, DateTimePickers would be more suitable as you will get more screen real estate to show the results.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.