Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use the latest date

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
Hi,

I have created a Required Reading database for my department.

I have a table called tblPrintDates with 2 fields - BDate and EDate - both being the date format.

When I print the report (rptReadingRequirements) I want to use the latest EDate (Ending Date) plus 1 day to become my BDate for the current printing of the report and the current date to be my EDate. Upon correct printing I want to be able to have an append query add the dates used to my table.

The reason for this is that I want to be able to recreate the reports should someone loose theirs without having to guess when I printed it.

Hope I have asked my question clear enough.



Ellie
**Using Access 97**

lena.wood@wgint.com (work)
elliefant@starband.net (home)
 
It mabey just me, but i don't understand exactyl what your are trying to accomplish. It sounded more like you want the latest date to show like: Max([Edate]) or it sounds like you want the date it printed on the report. please elaborate. "The greatest risk, is not taking one."
 
I want to be able to print a report between certain dates. I want the dates to be determined by a table that will store the print dates - so I can recreate that report if I need to without having to remember exactly when I printed it.

For example....if the last time I printed this report was on June 1, 2002, 06/01/02 would be stored in the EDate field. Now I want to print this report today so the BDate (Beginning date) would be 06/02/02 and the EDate (Ending Date) would be today 07/11/02. I want to be able to automatically store this dates in a table so I could recreate the report at any time.

Hope this makes what I am asking for a bit clearer.
Ellie
**Using Access 97**

lena.wood@wgint.com (work)
elliefant@starband.net (home)
 
It is still a little fuzzy. It looks like you want to edit what's on the table. You could create a form and I am not sure what criteria you are using, but if they are dates, you could create textboxes with the date ranges. Then click a button and use the
docmd.openreport(Myreport) and use the where clause for the dates.
bu before, you and do a

Dim Db As Database
Dim Rst As Recordset
Dim StrMyDate1 as string
Dim StrBDate as date

DtMyDate1 = txtDate1.value 'this is the textbox wiht the criteria

Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Tbl_InServiceLog", dbOpenDynaset)

rst.findfirst
or
rst.seek
rst.Edit
rst.fields("EDate") = date()
StrBDate = rst.fields("BDate").value
rst.fields("BDate") = strBdate + 1
rst.update
rst.close

then you can open up your report. I know this is a bit general and it may not be exactly what you are looking for but let me know what I am not understanding.
"The greatest risk, is not taking one."
 
Thank you so much for your help. My boss just changed his mind about what he wanted and now I don't need to be able to do this (Thank goodness!).

I appreciate your time and effort to help me out.
Ellie
**Using Access 97**

lena.wood@wgint.com (work)
elliefant@starband.net (home)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top