I have a form with two unbound text boxes Text_From and Text_to for Date ranges. Also a combo box for selecting some date ranges which should pass the values to the text boxes. I'm trying to use the following code with an event procedure.
If Me.CBORange.Value = "Current Month" Then
Me.Text_From = DateSerial(Year(Date), Month(Date), 1)
Me.Text_To = DateSerial(Year(Date), Month(Date) + 1, 0)
If Me.CBORange.Value = "All Records" Then
Me.Text_From = #1/1/1900#
Me.Text_To = Date
Else: End If
I've tried it with all the on events and get no change in the text boxes. What am I doing wrong? Thanks
If Me.CBORange.Value = "Current Month" Then
Me.Text_From = DateSerial(Year(Date), Month(Date), 1)
Me.Text_To = DateSerial(Year(Date), Month(Date) + 1, 0)
If Me.CBORange.Value = "All Records" Then
Me.Text_From = #1/1/1900#
Me.Text_To = Date
Else: End If
I've tried it with all the on events and get no change in the text boxes. What am I doing wrong? Thanks