473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Count Unbound Text Field?

48
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 3202
JConsulting
603 Expert 512MB
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.MyFooterTextbox = 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
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 Expert 512MB
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
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...
4
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...
3
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...
2
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...
2
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...
10
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...
18
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...
4
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.