Solved

Access DLookup next record

Posted on 2013-05-21
6
1,096 Views
Last Modified: 2013-05-23
Using Microsoft Access, I am trying to associate the punch out time with the punch in record.  See attached spreadsheet, column I is what I am trying to calculate.

Over the group of employees with the same employee number, each record has a sequential id that puts them in order.  I want to be able to take the next record punch time and associate it with the current record and call it the "punch out" time.  While processing the current record, if the previous record had a "punch out" time calculated, then don't calculate one for the current record.

Best to look at attached file, column I for what I need done.
clockexample.xls
0
Comment
Question by:ndornack
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:als315
ID: 39186563
If you have no multiple in-outs during day, you can take min and max time. Look at sample
DBInOut.accdb
0
 

Author Comment

by:ndornack
ID: 39187382
The problem with this solution is when an employee starts on one day and ends on the next.  Ie.
start 05/14/2013 at 2:30pm
end 05/15/2013 at 12:02 am

see attached file with example data added.
DBInOut.accdb
0
 
LVL 40

Expert Comment

by:als315
ID: 39188011
Look at qrySeq in sample
DBInOut.accdb
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:ndornack
ID: 39190731
I am trying this and getting the error:

Data type mismatch in criteria expression

for the query "qryInOutFinal"

What is wrong?
InOut.mdb
0
 
LVL 40

Accepted Solution

by:
als315 earned 500 total points
ID: 39192007
In your DB Employee Number is text, so in criretia you should add quotes around it:
"[EmpNum] = " & Chr(34) & [qryInOut00].[EmpNum] & Chr(34) & ....
InOut.mdb
0
 

Author Comment

by:ndornack
ID: 39192240
als315 - Works perfect, thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question