Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range Combo Box

Status
Not open for further replies.

jeffsal

Technical User
Oct 29, 2005
24
US
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
 
should go into the after_update event of the combobox, put a break in your code, and check the values that's being generated at that point...

--------------------
Procrastinate Now!
 
Anyway you have a coding error:
[!]Else[/!]If Me.CBORange.Value = "All Records" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top