Ok, first off what I'm attempting to do is to take my calendar control and have whatever is selected on it stored in a variable called enddate and then pass that to the query. I can't seem to get past the VB part of the code for this. I'm going to paste the code below. What should happen is when the person clicks on the calendar and sets the date the code should set the focus for both begindate and enddate. I will then run a query with those variables in them like this "where ((table1.date)>= [form]![formname]![begindate] and(table1.date)<= [form]![formname]![enddate]) or something along those lines, however whenever the calendar is clicked I get this message " Compile Error. Invalid Qualifier" and it stops on the begindate with the debugger.
Option Compare Database
Public begindate As Date
Public enddate As Date
Option Explicit
'Sets the end date to whatever is selected on the calendar1
Private Sub Calendar1_Click()
begindate.SetFocus
begindate.Text = "7/1/2002"
enddate.SetFocus
enddate.Text = Calendar1.Value
End Sub
Option Compare Database
Public begindate As Date
Public enddate As Date
Option Explicit
'Sets the end date to whatever is selected on the calendar1
Private Sub Calendar1_Click()
begindate.SetFocus
begindate.Text = "7/1/2002"
enddate.SetFocus
enddate.Text = Calendar1.Value
End Sub