Solved

Access DLookup next record

Posted on 2013-05-21
6
1,104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

751 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