Access Report only select first

I have an object in a Report that will list all of the names in the name field in one of my tables. I would like the report to only show the first name. Is there a way to define how many records a report object will show. See example below:

This is what I have currently (Report shows all names)
John
Sam
Tim
Tom
Jerry

This is what I would like my report object to show (Notice report only shows one name.)
John

The table of names changes frequently so I can not just type the name into a text object and enter it in.
ouestqueAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
If you only have a couple of controls that need this special treatment, leave the recordsource of the report the way you currently have it.  The field can be assigned the first value by setting the control source like thie (include the = sign):

= DFirst("MyFieldName", "MyQuery")
0
 
mbizupCommented:
If you want the first name, try changing the recordsource of your report to:

SELECT First(FieldName)
From YourTable
0
 
mbizupCommented:
Or


SELECT Top 1 [FieldName]
From YourTable

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mbizupCommented:
You should really close your open questions before asking any more new ones... you currently have nineteen open.
0
 
ouestqueAuthor Commented:
Sorry about that I am getting there :). They should all be closed by the end of the day today or tomorrow.
0
 
mbizupCommented:
Thanks for following up on that.
0
 
ouestqueAuthor Commented:
Currently my recordsource is a query. There are certain parts of my report that will need all the data from that recordsource. so If I modify my recordsource(query) directly, certain parts of my report will not show correctly. Is there a way to "tell" the object on my report only to only select the first on the list without changing my query.

I suppose I could just create a whole new query and use your SQL above to select the first, but my boss wants me to limit the number of queries, so if there is a way to modify the object directly, it would help greatly.

Example: This is what I am doing.

(My full query will show up on the report like below.)
John
Sam
Tim
Tom
Jerry

(I would like for the object to select only first on the list [kind of like a title for the list])
There for I will have 2 objects.

Object1: Title-----------------------------> John
Object2: List------------------------------>John
                                                              Sam
                                                              Tim
                                                              Tom
                                                              Jerry


0
 
ouestqueAuthor Commented:
Note: Object1 and object2 are using the same query(recordsource)
0
 
OnALearningCurveCommented:
Does you report ever grow larger than one page?

If not you could cheat and put the same control as your detail into the page header.  Tihis will display record 1 on page 1 and record 2 on page 2 .....

So if you only have one page John would appear in the page header for page 1 and then the full list of names could be displayed in the details section.

To be fair this is not the best way of doing things and fudging a report now may result in problems further down the line so make sure you investigate all other options.
0
 
ouestqueAuthor Commented:
cool idea learning curve, but my page can be many many pages long.
0
 
ouestqueAuthor Commented:
Awesome MB. Thanks!
0
 
mbizupCommented:
Glad to help :-)
0
 
ouestqueAuthor Commented:
Using MB's formula and Hiding duplicates will only show first row.
0
All Courses

From novice to tech pro — start learning today.