Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    2

    Unanswered: Month/Year Search

    I have a query labeled QryMain containing a field "date" that is filled as such 12/12/2012. In my form labeled FrmMain, I want to create a text box that a user can type a month and year in or if needed two separate boxes one for month one for year to return results for a specific month and year regardless the day. I can't seem to get this to work any way. I tried a few different ways. There has to be something out there...

    Thanks Everyone

  2. #2
    Join Date
    Aug 2011
    Posts
    2
    Well I figured out how to get this working using two seperate text boxes. One where the user will enter the month in digit form (1,2,3...) and one for the 4 digit year. Here is what I put for criteria for the Date field...

    Between DateSerial ([Forms]![FrmMain].[TextYear],[Forms]![FrmMain].[TextMonth],1) And DateAdd("d",-1,DateAdd("m",1,DateSerial ([Forms]![FrmMain].[TextYear],[Forms]![FrmMain].[TextMonth],1)))

    If anyone can get this to work easier it would be much appreciated but ti works for now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •