473,663 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with form/subform problem?

Ron
Hi All,

I've got a form called frmCust that has a subform on it called sfrmBalance.
sfrmBalance's control source is a query called qryTrans4CustBa l.
sfrmBalance has one field on it called fldTransTotal where the control
source is =Sum([LineTotal]). LineTotal is derived from Quantity * Amount
in the above query.

I have a checkbox called chkActive on frmCust that I want to allow the
operators to uncheck only if the balance of the customer is zero. How can I
code that, and where do I put the code so that it keeps them from changing
that checkmark if the customer's balance is NOT zero. I thought I'd just
enable = false that check box if balance isn't zero, but no way, no how can
I get the fldTransTotal to be anything but empty (as seen by the main form
frmCust). Yet, it looks fine on the form/subform when viewed and has
either a valid balance or an actual 0.

Help! Help! Thanks in advance,
ron
Mar 30 '06 #1
5 1846
"Ron" <ro************ *******@earthli nk.com> wrote in
news:Wi******** *********@newsr ead3.news.pas.e arthlink.net:
Hi All,

I've got a form called frmCust that has a subform on it called
sfrmBalance. sfrmBalance's control source is a query called
qryTrans4CustBa l. sfrmBalance has one field on it called
fldTransTotal where the control source is =Sum([LineTotal]).
LineTotal is derived from Quantity * Amount in the above
query.

I have a checkbox called chkActive on frmCust that I want to
allow the operators to uncheck only if the balance of the
customer is zero. How can I code that, and where do I put the
code so that it keeps them from changing that checkmark if the
customer's balance is NOT zero. I thought I'd just enable =
false that check box if balance isn't zero, but no way, no how
can I get the fldTransTotal to be anything but empty (as seen
by the main form frmCust). Yet, it looks fine on the
form/subform when viewed and has either a valid balance or an
actual 0.

Help! Help! Thanks in advance,
ron

Have you used the correct method of referring to the subform's
textbox? it must be addressed indirectly as
Forms!frmCust!s frmBalance.Form !fldTransTotal. value
sometimes me. equals Forms!frmCust but sometimes that doesn't
work.

I'd put the code in the checkbox's BeforeUpdate event so that a
non zero balance can force cancellation of the update.
But if fldTransTotal is the only field on the subform, why use a
subform at all? Just use a DSum() function call as control
source on a textbox directly on the mainform.

Then you could easily make the checkbox enabled based on the
value of the textbox.
--
Bob Quintal

PA is y I've altered my email address.
Mar 30 '06 #2
Ron
Thanks Bob, that took care of my problem. I removed the subform and put a
new textbox as you suggested. Works great! I think when I initially did
this main form I was all excited about forms/subforms and thought that was
the best way to do this.

Your solution works great though, so I switched everything around.

Thanks again!
ron

"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** *************@2 07.35.177.135.. .
"Ron" <ro************ *******@earthli nk.com> wrote in
news:Wi******** *********@newsr ead3.news.pas.e arthlink.net:
Hi All,

I've got a form called frmCust that has a subform on it called
sfrmBalance. sfrmBalance's control source is a query called
qryTrans4CustBa l. sfrmBalance has one field on it called
fldTransTotal where the control source is =Sum([LineTotal]).
LineTotal is derived from Quantity * Amount in the above
query.

I have a checkbox called chkActive on frmCust that I want to
allow the operators to uncheck only if the balance of the
customer is zero. How can I code that, and where do I put the
code so that it keeps them from changing that checkmark if the
customer's balance is NOT zero. I thought I'd just enable =
false that check box if balance isn't zero, but no way, no how
can I get the fldTransTotal to be anything but empty (as seen
by the main form frmCust). Yet, it looks fine on the
form/subform when viewed and has either a valid balance or an
actual 0.

Help! Help! Thanks in advance,
ron

Have you used the correct method of referring to the subform's
textbox? it must be addressed indirectly as
Forms!frmCust!s frmBalance.Form !fldTransTotal. value
sometimes me. equals Forms!frmCust but sometimes that doesn't
work.

I'd put the code in the checkbox's BeforeUpdate event so that a
non zero balance can force cancellation of the update.
But if fldTransTotal is the only field on the subform, why use a
subform at all? Just use a DSum() function call as control
source on a textbox directly on the mainform.

Then you could easily make the checkbox enabled based on the
value of the textbox.
--
Bob Quintal

PA is y I've altered my email address.

Mar 30 '06 #3
"Ron" <ro************ *******@earthli nk.com> wrote in
news:1g******** **********@news read2.news.pas. earthlink.net:
Thanks Bob, that took care of my problem. I removed the
subform and put a new textbox as you suggested. Works great!
I think when I initially did this main form I was all excited
about forms/subforms and thought that was the best way to do
this.

Your solution works great though, so I switched everything
around.

Thanks again!
ron
Thank you for the positive feedback. Glad to have helped. I
sometimes look at an application I did long ago, and wonder why
I did something in such a convoluted fashion.

Then I remind myself of having learned a better way. I suppose
in five years I'll look at my current creations and say, ewwww,
that was clumsy. Life is a learning experience..

"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** *************@2 07.35.177.135.. .
"Ron" <ro************ *******@earthli nk.com> wrote in
news:Wi******** *********@newsr ead3.news.pas.e arthlink.net:
Hi All,

I've got a form called frmCust that has a subform on it
called sfrmBalance. sfrmBalance's control source is a query
called qryTrans4CustBa l. sfrmBalance has one field on it
called fldTransTotal where the control source is
=Sum([LineTotal]). LineTotal is derived from Quantity *
Amount in the above query.

I have a checkbox called chkActive on frmCust that I want to
allow the operators to uncheck only if the balance of the
customer is zero. How can I code that, and where do I put
the code so that it keeps them from changing that checkmark
if the customer's balance is NOT zero. I thought I'd just
enable = false that check box if balance isn't zero, but no
way, no how can I get the fldTransTotal to be anything but
empty (as seen by the main form frmCust). Yet, it looks
fine on the form/subform when viewed and has either a valid
balance or an actual 0.

Help! Help! Thanks in advance,
ron

Have you used the correct method of referring to the
subform's textbox? it must be addressed indirectly as
Forms!frmCust!s frmBalance.Form !fldTransTotal. value
sometimes me. equals Forms!frmCust but sometimes that doesn't
work.

I'd put the code in the checkbox's BeforeUpdate event so that
a non zero balance can force cancellation of the update.
But if fldTransTotal is the only field on the subform, why
use a subform at all? Just use a DSum() function call as
control source on a textbox directly on the mainform.

Then you could easily make the checkbox enabled based on the
value of the textbox.
--
Bob Quintal

PA is y I've altered my email address.



--
Bob Quintal

PA is y I've altered my email address.
Mar 31 '06 #4
Ron
I did what you suggested and did away with the subform for this control.
It's all working much better now. Without the subforms, the screen builds
much faster each time it's loaded and switches from record to record MUCH
faster.

Thanks. I appreciate the knowledgeable response!
ron

"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** *************@2 07.35.177.135.. .
"Ron" <ro************ *******@earthli nk.com> wrote in
news:Wi******** *********@newsr ead3.news.pas.e arthlink.net:
Hi All,

I've got a form called frmCust that has a subform on it called
sfrmBalance. sfrmBalance's control source is a query called
qryTrans4CustBa l. sfrmBalance has one field on it called
fldTransTotal where the control source is =Sum([LineTotal]).
LineTotal is derived from Quantity * Amount in the above
query.

I have a checkbox called chkActive on frmCust that I want to
allow the operators to uncheck only if the balance of the
customer is zero. How can I code that, and where do I put the
code so that it keeps them from changing that checkmark if the
customer's balance is NOT zero. I thought I'd just enable =
false that check box if balance isn't zero, but no way, no how
can I get the fldTransTotal to be anything but empty (as seen
by the main form frmCust). Yet, it looks fine on the
form/subform when viewed and has either a valid balance or an
actual 0.

Help! Help! Thanks in advance,
ron

Have you used the correct method of referring to the subform's
textbox? it must be addressed indirectly as
Forms!frmCust!s frmBalance.Form !fldTransTotal. value
sometimes me. equals Forms!frmCust but sometimes that doesn't
work.

I'd put the code in the checkbox's BeforeUpdate event so that a
non zero balance can force cancellation of the update.
But if fldTransTotal is the only field on the subform, why use a
subform at all? Just use a DSum() function call as control
source on a textbox directly on the mainform.

Then you could easily make the checkbox enabled based on the
value of the textbox.
--
Bob Quintal

PA is y I've altered my email address.

Apr 4 '06 #5
Your kind thanks made my day. thank you!

"Ron" <ro************ *******@earthli nk.com> wrote in
news:lt******** *******@newsrea d1.news.pas.ear thlink.net:
I did what you suggested and did away with the subform for
this control. It's all working much better now. Without the
subforms, the screen builds much faster each time it's loaded
and switches from record to record MUCH faster.

Thanks. I appreciate the knowledgeable response!
ron

"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** *************@2 07.35.177.135.. .
"Ron" <ro************ *******@earthli nk.com> wrote in
news:Wi******** *********@newsr ead3.news.pas.e arthlink.net:
Hi All,

I've got a form called frmCust that has a subform on it
called sfrmBalance. sfrmBalance's control source is a query
called qryTrans4CustBa l. sfrmBalance has one field on it
called fldTransTotal where the control source is
=Sum([LineTotal]). LineTotal is derived from Quantity *
Amount in the above query.

I have a checkbox called chkActive on frmCust that I want to
allow the operators to uncheck only if the balance of the
customer is zero. How can I code that, and where do I put
the code so that it keeps them from changing that checkmark
if the customer's balance is NOT zero. I thought I'd just
enable = false that check box if balance isn't zero, but no
way, no how can I get the fldTransTotal to be anything but
empty (as seen by the main form frmCust). Yet, it looks
fine on the form/subform when viewed and has either a valid
balance or an actual 0.

Help! Help! Thanks in advance,
ron

Have you used the correct method of referring to the
subform's textbox? it must be addressed indirectly as
Forms!frmCust!s frmBalance.Form !fldTransTotal. value
sometimes me. equals Forms!frmCust but sometimes that doesn't
work.

I'd put the code in the checkbox's BeforeUpdate event so that
a non zero balance can force cancellation of the update.
But if fldTransTotal is the only field on the subform, why
use a subform at all? Just use a DSum() function call as
control source on a textbox directly on the mainform.

Then you could easily make the checkbox enabled based on the
value of the textbox.
--
Bob Quintal

PA is y I've altered my email address.



--
Bob Quintal

PA is y I've altered my email address.
Apr 4 '06 #6

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

Similar topics

2
4674
by: kma | last post by:
I am designing an Access 2000 database on a computer running Windows 98. I have one form with several tabs; all of which have sub forms, some with a subform on a subform. For example, on my main Job form I have a tab for PO's to keep track of all purchase orders pertaining to a specific job. The first subform is for the PO numbers related to the jobs on the main form and the next subform is for all of the PO lines for each PO. ...
4
1900
by: Jeremiah J. Burton | last post by:
I am trying to create a database (in Acces 2000) to track my fossil collection. I have a main table that has records for every specemen. I have a secondary table with information on localities that the specimens were collected at. The tables are linked. Each record in the specimen table will link to only 1 record in the locality table, however each locality can be linked to multiple specimens. I am trying to create a form (based on...
3
1956
by: Earthling | last post by:
Any help would be appreciated to solve the following simple problem that I will describe. *** There is a form called "red chocolate form". The form has a particular subform field that has a checkmark box that is selectable as on or off (on if there is a checkmark inside it). The table that contains the data for the form is known as "red chocolate
4
7002
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
4
2273
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5 companies on a form. 3 of the companies have common employees. I have a table that looks like this:
14
3097
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
2
2122
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a relative newcomer to Access and need to be methodical until it become more familiar. Thanks in advance for your help. I have a form with a subform that has a subform. form: frmEvents subform: sfrmTrialInfo (controlname = )
12
12929
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can we prevent this from happening? Thanks. ming
2
1430
by: Manystrengths | last post by:
Hello all. Briefly described this is the problem I am having. I have a form, with a related subform. On the subform I want to enter the expiration date based on criteria in the main form. I have tried placing code in the on exit event and the after update event with no luck. Please take a look at the code and let me know what you think. Oh yeah..... I can get this to work without using the main forms criteria ........ I tried doing...
0
8436
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
8345
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
8771
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...
1
8548
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
8634
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
7371
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...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
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.