Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access DLookup next record

Posted on 2013-05-21
6
Medium Priority
?
1,143 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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 

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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

783 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