473,406 Members | 2,698 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,406 software developers and data experts.

Popup form guidance

I want to add a facility for users to see associated records (from a related many to many arrangement) on a popup form. Creating the form and syncing should not be a problem but I want the Open Popup Form button on the main form to display the number of records on the popup.

Any guidance would be appreciated.
Jul 18 '18 #1

✓ answered by NeoPa

Squiddley1957:
is this still the case if the query (underlying the popup) is not running? Is it sufficient that the query exists?
No. However, if the popup is open then the query will be running. If you have a bound Form then the RecordSource is automatically opened whenever the Form is.

If you have a bound Form that's open then I'd advise using that. If it's either not open or not bound then the recordset isn't available and using DCount() is perfectly sensible.

9 1186
Further: I'm presuming that, in order to count the number of records on the popup, the popup must be open. This being the case the form visible property could be set to false and the Open Form button merely toggle the visible property? Would this work and/or is there a more elegant alternative?
Jul 18 '18 #2
twinnyfo
3,653 Expert Mod 2GB
Squiddley1957,

The Form does not need to be open, but you do need to know the RecordSource for that pop up form. Once you know that, you can count the records.

Hope that hepps.
Jul 18 '18 #3
The recordsource will be a query. What form would the coding take?
Jul 18 '18 #4
twinnyfo
3,653 Expert Mod 2GB
Let’s say you have a text box on your currently open form, named txtRecordCount. It’s record source would be =DCount("*", "YourQueryName") (Note: you will have to straighten out the quotes on that, as my iPad automatically makes smart quotes. If you have a SQL string for your query, you can use that string instead of the Query Name.

Hope this hepps!
Jul 18 '18 #5
NeoPa
32,556 Expert Mod 16PB
As Twinny says, it's not absolutely necessary to have the form open. However, it's generally a good idea if it doesn't complicate life too much. It's easy to add a TextBox onto a Form (Header or Footer Section) which counts the records. That way you count a recordset that's already open. You also don't need to worry about the recordset being complicated by any filtering as you're counting what's already there - predefined.
Jul 19 '18 #6
Hello Neopa

I have limited knowledge of coding. When you say that you count a recordset that is already open - is this still the case if the query (underlying the popup) is not running? Is it sufficient that the query exists?
Jul 19 '18 #7
twinnyfo
3,653 Expert Mod 2GB
If the query exists, using =DCount("*", "YourQueryName") should give the number of records returned in that query.
Jul 19 '18 #8
Thanks both to twinnyfo and NeoPa
Jul 19 '18 #9
NeoPa
32,556 Expert Mod 16PB
Squiddley1957:
is this still the case if the query (underlying the popup) is not running? Is it sufficient that the query exists?
No. However, if the popup is open then the query will be running. If you have a bound Form then the RecordSource is automatically opened whenever the Form is.

If you have a bound Form that's open then I'd advise using that. If it's either not open or not bound then the recordset isn't available and using DCount() is perfectly sensible.
Jul 19 '18 #10

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

Similar topics

2
by: Xenophobe | last post by:
I have a popup window (required by the client) containing a form and would like to prevent users from accessing it directly. They are instead required to access the page via a hyperlink on another...
0
by: RookieCard | last post by:
I've been stuck on this for 2 days. Here's the deal. I am working (3 levels down/deep)in a subform within a tab object that is within another tab obeject. Everything works great! Except here: 1)...
4
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) {...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
9
by: rousseaud | last post by:
I'm having some trouble getting popup forms to work properly. I have a main form that contains 4 fields that I want to fill in by using a series of 4 popup forms that I initiate by clicking a...
7
by: EManning | last post by:
I have an A2003 database linked to SQL Server 2005. My problem is with a popup form with a filtered table as a recordsource. I set the filter with an SQL statement like this: SELECT * FROM...
2
by: harvindersingh | last post by:
Hello guys, I am developing a Windows Forms application in C#, I am using PostgreSQL as the Database. The application is bassically using the database to store and lookup information, nothing so...
2
by: bigukfan | last post by:
I have an application that is used to collect clinical data from hospital patients involved in research. Various forms are used to collect specific data, often blood results. When the users enter...
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: 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...
0
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
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
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
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...
0
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
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,...

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.