>= Like Text

Guirg

Registered User.
Local time
Today, 12:20
Joined
Jun 2, 2009
Messages
96
Hey quick question,

I have a date column and have the following code which works perfectly but i can imagine a user asking just to simply search a year rather than a full date
Code:
  ' Check for min date
    If Me.txtdatemin > "" Then
        varWhere = varWhere & "[DateRun] >=  #"& Me.txtdatemin & "# And "
    End If
  ' Check for max date
    If Me.txtdatemax > "" Then
        varWhere = varWhere & "[DateRun] <= #"& Me.txtdatemax & "# And "
    End If

was wondering if theres any way of chaning the input to text and having a >= or <= LIKE something?

Cheers
Tim
 
Users are users, how is the user going to identify they only want to look at the year part of the date? When you have provided that functionality they will asume that they can look at just the month part of the date. Again are we talking about the calander year or the financial year? You bet your bottom dollar that the moment you give them a little bit of flexibility they will come up with different variations.

Take a look at a typical report generator I create for users. This uses a simple intellisense whereby they choose the date range by the use of an options group. Should they require an unspecified range they select custom dates and enter the dates manually.

You could expand on this methodology to give you the flexibility you foresee.

David
 

Attachments

  • RptGen.JPG
    RptGen.JPG
    46.2 KB · Views: 97
ahahahahh if only the users were programmers that would make life easy :P I have the date input in the form of DD/MM/YYYY with the date format but i have data that runs for about 4 years....ahahah ill just leave it so they have to put in 01/01/2009 to 01/01/2008 search between the years!!
Cheers
Tim
 
and its easy to find a date picker also

so in DC's example either provide a small command button, or clickable label, next to the start/finish dates - or dble-click the date itself - whichever seems the best for you -

use the appropriate click event to popup a dynamic date picker (loads of examples about) and easier than typing, as user can just do everything with a mouse
 
Cheers again!

Ive come across something very very strange while showing the form to my supervisor... Ive input all the dates as DD/MM/YYYY.... i go to my search button and to search the formats MM/DD/YYYY not sure why but when it searchs with that format it still pulls up the correct dates in DD/MM/YYYY... ahahahah i have no idea how to change the input to DD/MM/YYYY any ideas?

Confused

Tim
 
Change your format to dd/mm/yyyy
input mask 99/99/0000
 
The datas in the DD/MM/YYYY format - its the filter thats in the MM/DD format... is there anyway to change the filter?
 
No, Access queries (and thus filters by extension) are manditory in MM/DD/YYYY format.
 
ahahahahah thats the stupidest thing ive ever heard... :O so i either change my input data to MM/DD or i have a little text box explaining that access is backwards?
 
Access is not backwards, it is US... it is the US date format.
Then again we all know the US is backwards, so its all good :D *eek*

Alternative could be to use a date picker, where you simply display a calander (default build into *backwards* access). Users can the pick a date by clicking the mouse. The control will give you the date (since it is an access control) in us format.
 

Users who are viewing this thread

Back
Top Bottom