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

Birthday Query

Status
Not open for further replies.

greysquirl

Programmer
Jan 31, 2001
27
US
I have a query that returns an employee's name, address birthday etc. What I need to do is have the query only return the birthday's of employee's in the current month or have the query ask what month they want birthday's for. Is it possible to have a combo box that lists all twelve months in the year and then let the user select what month they want this info for and then have the query get that info?
 
Try this one out

Add an Expression Field in your query to capture the month in the field containing the birthday

Month: DatePart("m",[Birthdate])

Then Cut and Paste this into the Criteria Row

Eval("InputBox(""Enter The number of the month for the birthdays you want to display:"",""Need Month"",DatePart('M',Date()))")

PaulF
 
Here is another example using the combo box you wanted. Set the row source Type for your combo box to Value List, Type this into the row source 1;Jan;2;Feb;3;Mar;4;Apr;5;May;6;Jun;7;Jul;8;Aug;9;Sep;10;Oct;11;Nov;12;Dec
Then in the criteria row for birthday in your query enter this value DatePart('M',Forms!YourForm!YourComboBox)

John A. Gilman
gms@uslink.net
 
I forgot to mention, set the column count to 2 and the colum widths to 0";1"
John A. Gilman
gms@uslink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top