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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple date and time report

Status
Not open for further replies.

Conner

Technical User
Nov 29, 2000
44
0
0
US
Despite my efforts and some good tips from Tek-Tips, my "final" goal continues to elude me. What I want is a vary simple report:

John Doe
Date Time In Time Out Total Time
Feb 1 8:00 4:00 8 Hr 0 Min
Feb 2 7.55 4:10 8 Hr 15 Min
and so on...
Susie Doe
Feb 1 7:30 4:30 9 Hr 0 Min
Feb 2 9:30 3:30 5 Hr 0 Min
and so on...

I've tried everything and almost get it all together, but the right combination of tables, forms, subforms, events, time functions and so on continue to elude me...


I've tried a lot of combination of tables, forms and queries with just these fields: PinCode, LastName, FirstName,Date, TimeIn and TimeOut.

Nothing seems to work for me. What I want is for the user to enter their pincode,as form open up showing their name, the date and the time. Then the user "confirms" their sign-in or sign-out by clicking on a sign-in button in the morning and a sign-out button at the end of the day and the times be saved with the appropriate date. Then I'll use queries to do the time calculations, etc. Sounds simple...but something is eluding me.

I just can't get a truly "saved" record with all four pieces of data-Name,Date,TimeIn and TimeOut in the same record. I can get three pieces of the data, but not the fourth. And the one time I figured out how to get the last piece of data -- TimeOut--in a single record, I couldn't "save" it from one day to the next. There would only be one record in the report -- the last date. I've used update events, set form properties to "yes", "No" and any combination in between...

At this point, I can "populate" the underlying table with something that looks like this:

Name PinCode DateID Date TimeIn TimeOut
John Doe 1111 1 Feb 1 8:00
John Doe 1111 2 Feb 2 4:00
Susie Doe 2222 3 Feb 1 7:55
Susie Doe 2222 4 Feb 2 3:55

How do I get everthing all on the same "line" (record)or is their a way to use what I'm getting to create the report I need...

I'm ready to go back to square one and learn how to design this thing right.







 
Conner,

I believe reports are the weakness of ACCESS. You can write your own report and then open it in WORD and print it. If you would like an example, email me. Here is the code to write a simle report.

startcode:
Private Sub cmdReport_Click()
Dim rs As DAO.Recordset

Open "RiteReport.txt" For Output As #1

Print #1,: Print #1,: Print #1,
Print #1, Space(20) & "Special Report " & Now()
Print #1,: Print #1,
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
Do While Not rs.EOF
Print #1, Space(15) & rs.Fields(1), rs.Fields(2)
rs.MoveNext
Loop

rs.Close
Set rs = Nothing
Close #1
MsgBox "You file is named 'RiteReport.txt.' Look for it in the default ACCESS dir or Search with WINDOWS."

MsgBox "Also look at the function in the Global Module. You can open the file in it if you get the right references set."

End Sub
endcode


rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top