473,320 Members | 1,694 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,320 software developers and data experts.

Counting Text fields in a form

I am creating a form, the form contains a subform with 1 field and multiple text records. I want to insert a text box in my form that will count the number of text records in my subform... obviously the count() functions doesn't work because these are text fields... I thought DCount may work but i'm not quite sure how to use it any advice???
Jan 31 '16 #1
4 1504
zmbd
5,501 Expert Mod 4TB
If you want this on the master form:

>Child form
Footer: Insert textbox
(You can set the footer visible property to No and/or close the footer size down to basically nothing if you are using one of the form views instead of datasheet view. Also you could place this in the header... shrug)
Name: rcdCount
Visible: false
Control Source: =count([fieldname])
(or =count(*))

>Parent form
Insert Text box
Format and name as desired
Control Source =[fsubformcontainername]![rcdCount]

>> of course, if you want the display on the subform, then modify step one as needed and omit step two :-)
Jan 31 '16 #2
This doesn't work because my form uses a lookup up wizard to display the subform... therefore each record has a different number of records in the subform. If I count the records in the subform then it gives me a total of all records not the number that is displaying in my form
Jan 31 '16 #3
NeoPa
32,556 Expert Mod 16PB
HelpJess:
If I count the records in the subform then it gives me a total of all records not the number that is displaying in my form
You're not making yourself very clear. What was suggested should work if the instructions are followed properly. What exactly are you doing that isn't working?

If you write full and complete responses we can help you more easily than if you respond too quickly and without including all the relevant information. This will surely save you time in the end.
Jan 31 '16 #4
zmbd
5,501 Expert Mod 4TB
HelpJess:
Lookup wizards are not available for creating a subform.

There is a control wizard, and that will create the subform based on either an existing form, a table, or a query. If you have based the subform directly on either a table or query then this complicates things; however, if you have used another form, then what I have suggested will work.

++ There is a look-up field wizard, that creates either a lookupfield or a multivalue field in the table - this is not a subform and is what I am suspecting is the root of your quandary based on your two posts.
I am not so certain there is a way to obtain the count of related records in such a field... something we'll have to dig in to deeper...
>> However, as NeoPa has pointed out, you need to clarify what you have done here so that we have a better idea as to which direction to go.

BTW:
Lookup fields are really only valuable for SharePoint destined applications, in all other cases (IMNSHO) it should be avoided like the plague... The Evils of Lookup Fields in Tables

Lookup fields hide from the user what a properly normalized database should be doing...
Database Normalization and Table Structures

LUF/MVF are well intentioned; however, nightmarish to handle in queries and in VBA.... let alone in a calculated control.
Feb 1 '16 #5

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

Similar topics

1
by: Roy Adams | last post by:
Hello people I've recently been woring with multiple insert from text fields and got that woking fine thanks to the help from people from this forum now i'm trying to deal with multiple update,...
9
by: Paul Morrow | last post by:
I have seen the technique where a number of rows in a database are displayed in an html table so that each column of each row is editable. They use a single form surrounding the table, where each...
6
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
2
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
1
by: rick m | last post by:
We have an access DB that 2 input people use to tracking incoming patients. There is a form for them to do this but they find it confusing to use (it's plainly laid out, no one else complains about...
2
by: letam | last post by:
Hello, Thank you in advance for any help, it will be most appreciated! I need to be able to disable several text fields, until the user enters a value in a certain text field. Once they enter a...
2
by: Viktor | last post by:
I have a problem with counting empty fields in table. For example: I have the field in which i coulld write several solutions. "done", "not done", "send", "not send" etc. In report i want to...
3
by: martin DH | last post by:
Access 2003 I have a table (TASKS) filled with data from an external source. The table lists several tasks for employees to complete and has a text field (STATUS) that identifies where in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.