View Single Post
  #33  
Old March 23rd, 2008, 08:44 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Membership database updates

On Sun, 23 Mar 2008 03:03:02 -0700, Pennington
wrote:

In the Criteria cell of DateJoined in QryNewMembers I had put a date of the
form Between #dd/mm/yyyy# And #dd/mm/yyyy# and got a list of members who
joined between those dates. I now want it to work so that when I open the
corresponding Report I am prompted to put the month or year and I get a list
of members who joined in that month or year. I have tried the Expression
builder but can't seem to get it to work.


Part of the problem is that literal dates in Access MUST be entered in either
American mm/dd/yyyy format, or an unambiguous format such as yyyy-mm-dd.

Try creating a little form with two combo boxes, cboYear and cboMonth. The
former would have values for year numbers of interest for your case - 1950
through 2050 to be generous; the latter would have values "All" and 1 through
12. Your criterion would be

DateJoined = DateSerial(Forms!yourform!cboYear,
IIF([Forms]![yourform]![cboMonth] = "All",1,[Forms]![yourform]![cboMonth]), 1)
AND DateJoined DateSerial(Forms!yourform!cboYear,
IIF([Forms]![yourform]![cboMonth] = "All",13,[Forms]![yourform]![cboMonth])+1,
1)
--

John W. Vinson [MVP]