Onfirstrecord by group?

Posted on 2007-08-07
Last Modified: 2013-12-25
I need to perform an expression on the first record of each Group. So i need to identify such. By using Onfirstrecord if can get the first record in the report but i need it by group.
My report is grouped by Employee name
Question by:Tom_cfglending
    LVL 17

    Expert Comment

    Try using the MINIMUM function....


    LVL 9

    Accepted Solution

    Several solutions are possible.

    This could help:
      if onfirstrecord or
     {EMPLOYEE_NAME} <> previous({EMPLOYEE_NAME}) then 'First record in group!'

    Or you could create a running total that counts records and resets when the group changes....then whenever the running total = 1, you're at the first record of the group...

    LVL 28

    Expert Comment

    Either of Outin's solutions will give you the result you are looking for.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now