Rabu, 22 Oktober 2014

Re: [MS_AccessPros] Report Comments by date

 

Doyce-


I would think you might use AfterUpdate of the date text box to try to find a record.  If found, pre-fill in the text box on the form and set a module flag to indicate a record for that date already exists.  In AfterUpdate of the text box, either fetch and update the existing record (if the flag is set on) or add a new record.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 22, 2014, at 3:48 PM, winberry.doyce@roadsysinc.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

 

Hello everyone,

I have a daily inspection report that is run at the end of every work day that comes from various sources and includes subreports. This report is emailed out and works great. I have added a comment textbox on the form where the report is generated from where the user can add any comments for any miscellaneous activities that happen that day aren't tracked in the database such as Trailer # 123 has been repaired. The contents of this text box are included at the bottom of the report. The request has been made to save these comments in a table so if the report is re-run for a particular day at a later time, the comments will still appear on the report. To that end, I have created a table, tblInspectionComments that has an autonumber primary key, a date field and a comment field. Now I'm not sure the best way for the table to get populated if a record does not exist or to bring up the current record if there is a record for that date. Currently the form that runs the report has an unbound textbox where the date is entered and an unbound text box for the comments. It also has buttons to preview the report and email it out. The report uses the date in the textbox as criteria for selecting the records. What I would like to happen is for the comments entered to be saved in tblInspectionComments if there is no existing record and if there is an existing record for the comment box to show the comments that are in the table when the date is updated in the textbox. How is the best way to do that?

Doyce


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar