Results 1 to 8 of 8
  1. #1
    joewhitt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8

    Date Question

    I'm pretty new to Access but have worked through most of my problems. Now I'm just trying to make it "dumber" for users.

    Scenario: Built a database to store information on a non-profit food closet organization. People come in and are either new for the year (everybody is new in the month of January) or have been there before. I have made a report to show new people and old people broken up.

    Problem: When going through error check. The only way this works is if the new person isn't checked for the present month, then run report to get numbers, then go back in a mark them for the month. The only other way i can think to do it is have a separate report for each month.



    My query has New: IIf([Jan]="No" And [Feb]="No"...,1,0) and so on as a field.
    Question: is there a way to have it not count the current month and update that code each month?

    Any help will be appreciated.
    Last edited by joewhitt; 07-10-2011 at 12:56 PM. Reason: Solved

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    What is it you are error checking for? Why shouldn't new person be checked for the current month?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    joewhitt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    I'm just eliminating human error. By the way I have my If statement, when a new person goes through the line and the helper enters their information for the first time and they go ahead and check that month. When you run the report it wouldn't recognize that contact as a new person.

    I just want to know if there is a way to ignore the current month regardless of if it is checked or not.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Bad suggestion, removed comments.
    Last edited by June7; 07-10-2011 at 03:03 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60
    "My query has New: IIf([Jan]="No" And [Feb]="No"...,1,0) and so on as a field.
    Question: is there a way to have it not count the current month and update that code each month?"


    I don't quiet understand the question but I can tell you this:
    This month in VBA is: MonthName(Month(Date))
    Next month in VBA is: MonthName(Month(Date) + 1)

    May be you can use to do what you are trying to do!

  6. #6
    joewhitt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    I have a table called "Attended", in that table are twelve yes/no fields (each one labeled by month). A person that needs food might not show up every month. The state requires that each month you have numbers for new and for recurred(old). If you have been there any month before you are counted as old.

    Since it is voluntary work there might be a different person every month that enters the data. If a new person, wanting food, comes in and the volunteer enters info and then checks the current month(lets say July).

    By my query which creates a new field called New: (with an if statement checking all twelve months.

    I know i can just leave the current month out, but i just don't want to change the code every month to exclude whatever month i am in.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I tested some data and think this works:
    SELECT * FROM Attended
    WHERE (((IIf(IIf(Month(Date())=1,"",[Jan]=No) And IIf(Month(Date())=2,"",[Feb]=No) And IIf(Month(Date())=3,"",[Mar]=No) And IIf(Month(Date())=4,"",[Apr]=No) And IIf(Month(Date())=5,"",[May]=No) And IIf(Month(Date())=6,"",[Jun]=No) And IIf(Month(Date())=7,"",[Jul]=No) And IIf(Month(Date())=8,"",[Aug]=No) And IIf(Month(Date())=9,"",[Sep]=No) And IIf(Month(Date())=10,"",[Oct]=No) And IIf(Month(Date())=11,"",[Nov]=No) And IIf(Month(Date())=12,"",[Dec]=No),1,0))=1));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    joewhitt is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    Awesome, that worked!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Of course...a Date Question
    By ffowler in forum Queries
    Replies: 3
    Last Post: 06-08-2011, 03:44 PM
  2. Due Date Form question
    By AcmeGearSteve in forum Access
    Replies: 10
    Last Post: 10-29-2010, 12:30 PM
  3. form question-auto date?
    By darklite in forum Access
    Replies: 4
    Last Post: 09-02-2010, 09:32 AM
  4. Query (Date Question)
    By cillajones in forum Queries
    Replies: 1
    Last Post: 08-09-2008, 12:05 PM
  5. Question about creating a date calculation tool
    By bazillion in forum Programming
    Replies: 0
    Last Post: 01-25-2008, 12:08 PM

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
  •  
Other Forums: Microsoft Office Forums