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

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 qryTrans4CustBal.
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 1833
"Ron" <ro*******************@earthlink.com> wrote in
news:Wi*****************@newsread3.news.pas.earthl ink.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
qryTrans4CustBal. 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!sfrmBalance.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******@sympatico.ca> wrote in message
news:Xn*********************@207.35.177.135...
"Ron" <ro*******************@earthlink.com> wrote in
news:Wi*****************@newsread3.news.pas.earthl ink.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
qryTrans4CustBal. 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!sfrmBalance.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*******************@earthlink.com> wrote in
news:1g******************@newsread2.news.pas.earth link.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******@sympatico.ca> wrote in message
news:Xn*********************@207.35.177.135...
"Ron" <ro*******************@earthlink.com> wrote in
news:Wi*****************@newsread3.news.pas.earthl ink.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 qryTrans4CustBal. 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!sfrmBalance.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******@sympatico.ca> wrote in message
news:Xn*********************@207.35.177.135...
"Ron" <ro*******************@earthlink.com> wrote in
news:Wi*****************@newsread3.news.pas.earthl ink.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
qryTrans4CustBal. 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!sfrmBalance.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*******************@earthlink.com> wrote in
news:lt***************@newsread1.news.pas.earthlin k.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******@sympatico.ca> wrote in message
news:Xn*********************@207.35.177.135...
"Ron" <ro*******************@earthlink.com> wrote in
news:Wi*****************@newsread3.news.pas.earthl ink.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 qryTrans4CustBal. 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!sfrmBalance.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
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...
4
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...
3
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...
4
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...
4
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...
14
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 ;...
2
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...
12
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.