473,658 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Count Unbound Text Field?

48 New Member
I've looked, and not found much. I have a text field in a form named [myLocation], which acquires its data through a control source of =getLocation()

the getLocation() function returns a DLookup, which changes based on some other field of that record.

Now, I would like the form footer to count the two different locations that may occur. So, naturally I tried:

=Count(IIf([myLocation]="Home",0))

This not only returns #Error on that field, but every other (otherwise working) counting field in the footer. Same thing happens even if I just count([myLocation]). Clearly there's something that I wasn't told. I half-expect a group of my techie friends to pop out of somewhere laughing at me cuz they purposely removed a page from my reference book or something. Any help is greatly appreciated.


Oh and a secondary issue: is there some easy way to count unique field values in a filtered form whose filtered criteria is constantly being changed from the form? (I expect the answer is "no, there is no easy way" - that's fine, just need to know).

All help is always apreciated.
Mar 21 '08 #1
3 3218
JConsulting
603 Recognized Expert Contributor
I've looked, and not found much. I have a text field in a form named [myLocation], which acquires its data through a control source of =getLocation()

the getLocation() function returns a DLookup, which changes based on some other field of that record.

Now, I would like the form footer to count the two different locations that may occur. So, naturally I tried:

=Count(IIf([myLocation]="Home",0))

This not only returns #Error on that field, but every other (otherwise working) counting field in the footer. Same thing happens even if I just count([myLocation]). Clearly there's something that I wasn't told. I half-expect a group of my techie friends to pop out of somewhere laughing at me cuz they purposely removed a page from my reference book or something. Any help is greatly appreciated.


Oh and a secondary issue: is there some easy way to count unique field values in a filtered form whose filtered criteria is constantly being changed from the form? (I expect the answer is "no, there is no easy way" - that's fine, just need to know).

All help is always apreciated.
Your question isn't really clear. Are there more than one fields that you're counting?

You can try using your form's On_Current event to put a value in your count field

If me.MyTextbox = 'somevalue' Then me.MyFooterText box = 1

also, wouldn't your syntax be a bit different with the IIF function anyway?

=IIf([mytextbox]="Home",1,0)

But again, if you have a single view form, wouldn't your count always be 1 or 0?
Mar 23 '08 #2
isoquin
48 New Member
My appologies for the lack of clarity. I'm using a continuous form, with multiple records being displayed at any given time. Furthermore, the records displayed do not change with a query, but by the Me.Filter and vba. The user will be readily changing the filter, and displaying different items frequently. As such, i was hoping for a running tally of certain records. Specifically, a sum or count of a field, whose value is generated from a vba function.

Help? =(
Mar 26 '08 #3
JConsulting
603 Recognized Expert Contributor
My appologies for the lack of clarity. I'm using a continuous form, with multiple records being displayed at any given time. Furthermore, the records displayed do not change with a query, but by the Me.Filter and vba. The user will be readily changing the filter, and displaying different items frequently. As such, i was hoping for a running tally of certain records. Specifically, a sum or count of a field, whose value is generated from a vba function.

Help? =(

since this is already VBA, and you apply a filter using some mechanism, why don't you continue to use VBA and capture the filter being applied, and use that as a criteria agains the recordset in a dcount to populate your count field.
Mar 30 '08 #4

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

Similar topics

1
19160
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
4
14269
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I am planning to pass a dataset to the report at runtime. From what I have read, it sounds like unbound fields might be the answer. However, I am having trouble figuring out how to bind these unbound fields to my dataset at runtime.
3
3772
by: Dos Lil | last post by:
I have a unbound field in the subform(for calculating the datediff) which has the control property ==DateDiff("n",,). I have another unbound field in the main form which is for displaying the datediff from the subform.I have set the controls source = .Form! FRM- TimeSheet Subform is the name of the subform and TXTTtalHoursworked is the name of the unbound field in the subform.
2
2276
by: Dave Griffiths | last post by:
Access 97 - I have a form with a single unbound text field. I want to have a timer event which periodically saves the contents of that field. But I noticed that if the focus stays on the field then then the text doesn't get saved. It's like the text isn't there until focus is moved off the field. So does anyone know how to grab the contents of an "uncommitted" field without moving the focus? By the way, I tried moving the focus away,...
2
3880
by: Zlatko Matiæ | last post by:
Hello. I have the following problem with MS Access/PostgreSQL combination: There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records. There is a DAO Append Query that has a parameter that is passed from the text box using parameter of DAO QueryDef object. I adjusted B7 parameter (Text as LongVarchar) in connection string (ODBC driver) to 1, so that Access links PostgreSQL Text fields as...
10
3230
by: Matthew Wells | last post by:
Hello. I've converted a bound Access 2000 form which displays data retrieved from an Access 2000 database to an unbound form. Now my hyperlinks don't work. I'm assuming it's because the form isn't bound anymore. I didn't even have that field's data type as hpyerlink - just test. I did have the form control's "hyperlink" property set to true and it worked fine in bound mode. The fields stores paths to pdf files. How can I make the...
18
3784
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having trouble. I have tried keeping some of the fields bound and when I use the save button it has been saving as 2 different records. This is unacceptable. This is what I have, can anyone help me out with this?
4
5532
by: Susan Bricker | last post by:
I have a form that displays record information in Continuous Record display (scrollable list). One of the fields in the record is an Integer value called "rcode" (reason code). But, I don't want to display the reason code integer value. I want to display the reason code descriptive text (string data). So I have a TEXT BOX object on the form to display the text. I have an public array defined(global variable defined in CommonProcs...
1
2235
by: MyWaterloo | last post by:
I have an unbound text box on my main form that is used to show the sum totals in my sub form. I also have a field on my main form that has a control source in a table. This bound field needs to somehow have the total form the unbound text box transferred to it. How do I go about this? I have multiple categories that can be selected through a combo box. So I am sometime just flipping through categories to see what my total is. I could just...
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
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.