473,480 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Display a Number from a Report into a Text Box

6 New Member
Hi,

Im trying to display a =count([last name)] number from a report into a Text Box on a form, so I can see the number without having to open and close this report
May 23 '16 #1
13 1273
PhilOfWalton
1,430 Recognized Expert Top Contributor
The report is irrelevant. What is important is the RecordSource of the report. Assuming it has something to do with table of names, you can use the DCount Function.
If you want to count all the names in your table the ControlSource of your text box will be something like
Expand|Select|Wrap|Line Numbers
  1. =DCount("Last Name", "TblName")
  2.  
If the count of the names is filtered, we would need to know which names are included.

As an aside, I strongly recommend that you don't have spaces in your field names, because they will have to be enclosed in square brackets thus
[last name]
Better is last_name, but my preference is LastName.

Phil
May 23 '16 #2
Jamie805
6 New Member
Hi Phil,
I tried your function, but it won't look at the Report or display what I'm looking for.
Comes up with The expression you entered contains invalid syntax
May 23 '16 #3
PhilOfWalton
1,430 Recognized Expert Top Contributor
What is the name of your table that holds the people's names?

Phil
May 23 '16 #4
Jamie805
6 New Member
It's a report called Class 1 it has
Last name First name position
And on the top in the header it has
=count([lastname])
I'm trying to get this figure displayed in a text box,
So I don't need to open and close each report to see
How many are in a class
May 23 '16 #5
NeoPa
32,556 Recognized Expert Moderator MVP
Jamie.
Any reference to a report, or any control on a report, will fail unless that report is open at the time it's referenced.

Reports don't contain data. They merely display the data. The report object is a definition of where to find the data and how to display it.

Thus, attempting to reference data from a report that isn't open is entirely futile. I'm afraid you'll need to look elsewhere.
May 23 '16 #6
PhilOfWalton
1,430 Recognized Expert Top Contributor
Sorry, I obviously didn't make myself clear.
The report is irrelevant, it just happens that it displays the information that you want.
What I am trying to find is the table or query that is used as a basis for your report. When we have that information we can easily get the count of the last names.

At the moment, things are getting confused because in one part of your question you refer to last name with a space, and in your last post you refer to lastname with no space.

I asked for the name of the table that holds the last name information and got no reply. Can't help unless you answer the questions.

Phil
May 23 '16 #7
Jamie805
6 New Member
My Query
Last Name then in the next column First Name and next column Class, then position in the last column
All I'm asking from the report that's made from this query is to show the amount of people that is in this class to be displayed in a text box separate, but linked to the report.
In the report I have =count([LastName]) as you suggested to join them together. Which gives me the total in the class, but I would like it displayed in a text box outside the report, so each time the class gets updated it will show the amount of people in the class without having to open the Report.
Sorry for the confusion
May 24 '16 #8
Jamie805
6 New Member
Can you do it from a query then
May 24 '16 #9
NeoPa
32,556 Recognized Expert Moderator MVP
We keep responding in the strongest possible terms that your way of thinking is way off base and that what you're trying to do is impossible to do that way.

There's no sign that you've understood this yet. I can't see why.
May 24 '16 #10
NeoPa
32,556 Recognized Expert Moderator MVP
You can do it from a query or a table. Though a query doesn't store any data either, it does provide data as output.

To help with how to get this information from your existing data though, we'd need some basic details (at least) pertaining to how your data is stored and what data you're actually trying to show.

So far, everything you've explained doesn't really make sense, so it's difficult to work out what you actually want to do.
May 24 '16 #11
Jamie805
6 New Member
Ok, I'm sorry for the confusion I'm given...
In my query is displayed the total number of people in my report. I would like this total to be visible in a text box if that is possible
May 24 '16 #12
PhilOfWalton
1,430 Recognized Expert Top Contributor
We are struggling here. Jamie is obviously obsessed with this report.
I think what he's after is
Expand|Select|Wrap|Line Numbers
  1. DCount("LastName","WhateverYourSecretTableNmaeIs","Class = " & Chr$(34) & "YourClassFromYourReport" & Chr$(34)
  2.  
As you won't tell us what your table structure is and how you select what class your report is based on, I regret I can spend no further time on this topic.

Phil
May 24 '16 #13
NeoPa
32,556 Recognized Expert Moderator MVP
I get a similar strong feeling that paying attention and actually responding to the many and various prompts is not a strong point. I'll respond again if/when I get a hint that things have changed and you're prepared to put at least a modicum of attention to this, your own question thread.
May 25 '16 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1503
by: Michael | last post by:
Hello, Is there a way to display Crystal Report file without depending on the Win form with CrystalReportViewer control in it, such as evoke the Crystal Report engine directly or something like...
0
1172
by: Robert | last post by:
I find that most of the time my Access reports are displayed in print preview mode rather than printed on the printer. Converting these reports to a form with a continuous view is difficult...
8
3480
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
1
5765
by: Regnab | last post by:
Ive got a form on which I would like to display a report (sub-report). I tried to do this through subform/subreport, but it only allows a subform. Is it possible to display the report? Cheers ...
3
1287
by: Mustufa Baig | last post by:
I would to be able to display crystal report via ASP.NET by using CrystalViewer Web Component and by exporting as well. Thanks.
8
10479
by: rzaleski | last post by:
I am trying to display a Crystal Report in an application I developed. I used the following tools: Microsoft Visual Studio.NET 2005 Standard Crystal Reports 10 Professional I am using the...
1
1837
by: lihao0129 | last post by:
The scenario is a RTF(Rich Text Format) editor where I can input text and meanwhile display 'style'd text or multimedia( i.e bold fonts, pictures, movies ) in the same box... I am currently...
2
2109
vikas251074
by: vikas251074 | last post by:
I am creating an application for official use. This application will be used by employees to take items for official use. I have a list, presently this list contains three items - 1) Cartridges, ...
4
7177
subedimite
by: subedimite | last post by:
Here I am with another question being a very new VBA user. I have this scenario to work with: I would think this is fairly common routine of work for VBA. I have a string of hex contents as...
1
1364
by: chibbie23 | last post by:
Hi, I have a table in mssql which holds the data i display on my "News" page. I wanted the user to be able to style the details of the news, so i store the details on a column with a text data...
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7050
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7091
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.