Results 1 to 8 of 8
  1. #1
    Kicked is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Post How to fill, selected by a quarry, table fields automatically?

    Hi,

    I have got table containing informations about Change Notes. Every so often this Change Notes are finished. I have got a Report showing finished Reports between certain dates (from date; to date). Next time, when I am generating Report, using te same dates or dates partially covering previous dates, access shows already printed Change Notes. I want to avoid duplicates on Reports and I want to have these Reports to be saved with certain date to be archived. Please help me.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Filter the Change Notes records by some criteria.

    What do you mean by 'archive'? You mean the actual physical paper report?
    Last edited by June7; 06-10-2011 at 12:45 PM.
    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
    Kicked is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Post

    I need some way to let Access know, that, the records (Change Notes) has been already in the Report (Printed, mailed etc.). So next time, I will not get them again in the report. Well. There is a way to make it manually, opening every record and adding some info, but I need this to be done automatically. Like, for example: every Report will add to Change Note Table an information about a date of the Report. So next day report will not include them. About archiving, I think I have got it. When Report is made, I have added Macro which is saving Report as an file on the disc. This is perfect archive as I can share this files with others on the network. Just this problem with automated adding Date to the specific records in the table when Report is done, printed what so ever. Hard to explain.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    You need a field for filtering records. Say, a Status field (Date, Yes/No, or Text type). Code could automatically update this field when report is run. Report would include all (unless you have some additional criteria to be considered, like customer ID) records where this field is No or Null (depending on which type you go with) then code would update the No or Null to some value. Have to consider possibility of need to rerun the report. I would go with the date field. Update field to date of report. Then could have option to rerun a report from a given date (either keep the date or modify for the rerun).
    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
    Kicked is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Post

    Well, I know, I need another field in Change Note Table. I know, it should be a date field. The only problem is: how to make automatic function to update date field when report has been made? I have already included Macro which is saving Report as snapview on the hard disc when Report is made.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Use an SQL UPDATE. I don't know if this can be done in macro, I only use VBA.

    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE tablename SET fieldname=somevalue WHERE fieldname=criteria"
    DoCmd.SetWarnings True

    Code could be in the same event that triggers opening the report.
    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.

  7. #7
    Kicked is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Post It does not resolving my problem

    Well, if you can give me an idea how to make Report during process of closing down update Table Field with a current date I will be happy. Maybe tomorrow I bring this files over and make an attachement to the Reply.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    The example in previous post shows UPDATE with literal strings. You would have to concatenate the variable values.
    DoCmd.RunSQL "UPDATE tablename SET datefieldname=#" & Date() & "# WHERE IDfieldname=" & Me.IDtextbox
    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: 0
    Last Post: 03-08-2011, 05:56 PM
  2. Replies: 1
    Last Post: 12-09-2010, 08:29 AM
  3. Auto fill field upon New Record selected
    By NOTLguy in forum Programming
    Replies: 27
    Last Post: 12-05-2010, 05:12 PM
  4. Replies: 2
    Last Post: 09-20-2010, 09:02 PM
  5. Replies: 1
    Last Post: 08-17-2010, 02:33 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