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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Part Date mm/yy problem

Status
Not open for further replies.

boredpilot

Technical User
Nov 29, 2005
8
GB
Hello everyone

I need to be able to force a form that I have to just ask for mm/yy for the date information. Any ideas how I set that up. I cannot have it as 2 text list boxes as I need to run a query to find all advertisments that clients have placed from this month through to eg 2010.

Then if you can answer above im assuming it would be fairly simple for the query to find the now till 2010 by getting the user to again input a mm/yy into a form and pass that through to the query

Many thanks
Neil
 
I do not quite see why you should not have two boxes, a combo for month and a textbox for date. Your query could either use dateserial to build a comparison date or simply use the month and year information.

Some Rough Notes
DateSerial(Forms!Picker!ToYear,Forms!Picker!MonthNo,1)

Select * From tblTable Where Month(tblDate.AdDate)= Forms!Picker!MonthNo And (Year(tblDate.AdDate) Between Year(Now()) And Forms!Picker!ToYear)
 
Thanks for the reply but I dont understand what you are suggesting (Im a little dim)

All I need is for the date field in the form to just except mm/yy from the user. Is this something which is easy to do.

What I did have set up but is causing me problems for one query was a list box with the months created in it and another one with years from 2006 t0 2013 created, the problem I then had was trying to make a qoery that would go from eg this month this year to last month 2013 since these values in my list boxes where only text values after all.

Appologies for my dimness hear

Thanks for any help
Neil
 
Any text box will accept mm/yy. You can use your previous set-up with listboxes, especially if you have a hidden month number column. It may be best to post the SQL you are having problems with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top