473,793 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with counting selected records on form

I have a continous form.
That form has three checkboxes, two unbound and one (MyCheckbox1)
bound to MyField.
The whole form is bound to the table tblMyTable which contains the
field MyField.

Whenever one of the two unbound checkboxes are chosen a query is run
on MyTable and the
field(s) MyField will be set to True or False

I want to know how much of the MyFields in MyTable are set to True. In
realtime.

I wrote this code:

Sub CountSelected()
Dim varNumberSelect ed
DoCmd.Save
varNumberSelect ed= DCount("MyField ", "MyTable", "MyField = True")
Me.txtNumberSel ected = varNumberSelect ed
End Sub

Whenever this code is called is runned from one of the unbound
checkboxes it runs hypersweet but when it is called from the unbound
checkbox it seems to be lagging one behind. I suspect this has to do
with the form being dirty but saving the form on beforehand does not
work, where am I going wrong? Any one can shed some light? Thanks in
advance!

Henro

Mar 9 '07 #1
0 1169

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2306
by: Mike N. | last post by:
Hello: I have a form that contains a multiple-select field that has 12 options in it. I would like the user to be able to select UP TO FOUR of those options. If they select more than four, I would like to alert them of the error. To do this, I figure that counting commas would be the easiest method (i.e., IF commas > 3 THEN alert user). NOTE: I have an existing "validateForm" function for this form and I'd like to add this IF-THEN...
2
2622
by: David | last post by:
Hi, I have an order form which has a field 'ProductID'. This form has a button on each record to open a new form linked by ProductID. This new form is a continuous form and obviously, only displays the records associated with that ProductID. Basically this is part of a Product Packing Pick System. From my products table, each product has a set default amount of items which
14
2132
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these grid and write to the database and I set the new Primary Keys and related Fields to the new asigned atuonumbers in the Access.
1
1878
by: RLau | last post by:
Hi All, I have created a form and subform ( Assignee Outstanding Form ) to display records and related notes in a Helpdesk database table by the assignees respectively. Now, instead of clicking through hundreds of records by assignees in alphabetical order, I would like to use a pop-up form to be opened when the Assignee Outstanding Form is loaded - of which the data come from a query, so the records displayed in the Assignee Outstanding...
0
1446
by: annivanova | last post by:
Hi, I saw posts in Dependent listboxes on access forms, which problem is very similar to my. I’m working over to create an MS Access application. I used in my project given code : Code: Private Sub Country_AfterUpdate() With Me! If IsNull(Me!Country) Then ' if no country is selected .RowSource = "" ' leave row source of Region blank
4
1916
meLady
by: meLady | last post by:
Hello, I have a form called feedback with a subform called feedback Options. I did some counting calculation in master form "feedback" at the bottom page. the calculation is about count the number of yes, no and null that are in the feedback Options. the problem is that when navigate to a new form the calculation of the previous form is still in and I tried many times to find a solution but I couldn't ...
5
1905
by: jasone | last post by:
Hi all, im nearly there with this one and im sure it shouldnt be hard to solve, i just cant seem to find the solution. ive got records being displayed, the user can then tick what records to delete... click delete.. it shows deleted records then you can go back to the screen, It works if one record is selected but any more it doesnt delete any so im sure there is a problem with my SQL statement. the code for the 2 pages have been shown...
8
1500
by: jasone | last post by:
Hi all, im nearly there with this one and im sure it shouldnt be hard to solve, i just cant seem to find the solution. ive got records being displayed, the user can then tick what records to delete... click delete.. it shows deleted records then you can go back to the screen, It works if one record is selected but any more it doesnt delete any so im sure there is a problem with my SQL statement. the code for the 2 pages have been shown...
2
3017
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that. Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
0
10430
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...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
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
7538
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
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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...
1
4111
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 we have to send another system
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.