Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2014
    Posts
    2

    Thumbs up autofill from with specific condition check

    Dear Members, I want to Autofill one of the field in my form, by checking specific conditions in my database. Example of which is as below:

    1. Date of Maintenance :
    2. Loom No. :
    3. Component Replaced :
    4. Component Type :
    5. Latest date for same component replacement :

    I want to autofill the Sr. No. 5 in the form itself by checking database, and if Sr. No.2=Sr No.3=Sr. 4, then latest date should be autofill in Sr. No. 5

    Say, A component was replaced in a Loom on 01/01/2013 & again after six month same component is replaced on 01/06/2013 so while filling up the form, In sr. no. 5 latest date 01/01/2013 of replacement of same component in same loom should be pulled from data base.



    Pl. help me...

    Thanks in advance

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Saving calculated values is usually a bad idea. Calculate when needed. The 'latest' date can be retrieved with a query.
    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
    Join Date
    Jan 2014
    Posts
    2
    pl. explain in detail...i m new for ms access

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    One way is with a GROUP BY (Totals) aggregate query.

    SELECT Loom, Component, Max([Date of Maintenance]) AS MaxDate FROM tablename GROUP BY Loom, Component;

    Another is DMax() domain aggregate function.

    DMax("[Date of Maintenance]", "tablename", "Loom=loomIDhere AND Component=componentIDhere")

    Domain aggregate functions can be used in query or textbox on form/report.

    Access Help has more guidelines on both, also a lot on web.
    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.

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

Similar Threads

  1. Replies: 35
    Last Post: 01-08-2014, 01:33 PM
  2. Replies: 5
    Last Post: 08-21-2013, 03:17 PM
  3. Check if record exists, Check Number
    By burrina in forum Forms
    Replies: 9
    Last Post: 01-06-2013, 03:49 PM
  4. Replies: 1
    Last Post: 06-15-2012, 05:51 PM
  5. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM

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