A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Overwrite a calculated control



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2005, 01:01 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Overwrite a calculated control

I search for an answer on my question without luck, so here goes.

I a form i have a control A, [Lenght1], a control B, [width1], and a control
C [Area1].
What I want this controlers do do is this:
- Calculate the area in control C when fill in values in control A and B
- or write the area direct in control C and set A and B to zero or nothing
if there are values in them
- and have the value area too be shown in the table someway.
How do I do this?

Regards
--
TomH
  #2  
Old December 7th, 2005, 01:19 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Overwrite a calculated control

Hi Tom
There is no need, and you shouldn't, store the calcuated field in the table.

In the form,you can write in the control source of field C
=IIf([A] Is Null Or [b] Is Null,0,[A]* [b])

To get the resault as a table, create a query based on the Table above

Select [A],[b], IIf([A] Is Null Or [b] Is Null,0,[A]* [b]) As [C] From
[TableName]

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

I search for an answer on my question without luck, so here goes.

I a form i have a control A, [Lenght1], a control B, [width1], and a control
C [Area1].
What I want this controlers do do is this:
- Calculate the area in control C when fill in values in control A and B
- or write the area direct in control C and set A and B to zero or nothing
if there are values in them
- and have the value area too be shown in the table someway.
How do I do this?

Regards
--
TomH

  #3  
Old December 7th, 2005, 01:55 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Overwrite a calculated control

Thanks for answer.
I do what you mentioned, and half of my questin is answered. The other part
is that I want to write the area directly in control C if I dont know A or B
(this happens from time to time).
Lets say i have an area 10m2, then I want too write 10 in the C controller,
and if there are any values in A or B, I want this to be set to 0 or nothing.

It maybe unsolvable or a dreamwish from me?

--
TomH


Ofer skrev:

Hi Tom
There is no need, and you shouldn't, store the calcuated field in the table.

In the form,you can write in the control source of field C
=IIf([A] Is Null Or [b] Is Null,0,[A]* [b])

To get the resault as a table, create a query based on the Table above

Select [A],[b], IIf([A] Is Null Or [b] Is Null,0,[A]* [b]) As [C] From
[TableName]

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

I search for an answer on my question without luck, so here goes.

I a form i have a control A, [Lenght1], a control B, [width1], and a control
C [Area1].
What I want this controlers do do is this:
- Calculate the area in control C when fill in values in control A and B
- or write the area direct in control C and set A and B to zero or nothing
if there are values in them
- and have the value area too be shown in the table someway.
How do I do this?

Regards
--
TomH

  #4  
Old December 7th, 2005, 02:30 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Overwrite a calculated control

In that case bound the C field in the form to the C field in the table.
On the after update event of fields A and B write the code

If not Isnull(Me.A) and not Isnull(Me.B) and Me.A 0 and Me.B 0 then
Me.C = Me.A * Me.B
Else
Me.C = 0
End If
==================================
About the second part, if I understood you, and you want to set A and B to 0
if you enetee value in C , then on the After update event of field C, write
the code
Me.A=0
Me.B=0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

Thanks for answer.
I do what you mentioned, and half of my questin is answered. The other part
is that I want to write the area directly in control C if I dont know A or B
(this happens from time to time).
Lets say i have an area 10m2, then I want too write 10 in the C controller,
and if there are any values in A or B, I want this to be set to 0 or nothing.

It maybe unsolvable or a dreamwish from me?

--
TomH


Ofer skrev:

Hi Tom
There is no need, and you shouldn't, store the calcuated field in the table.

In the form,you can write in the control source of field C
=IIf([A] Is Null Or [b] Is Null,0,[A]* [b])

To get the resault as a table, create a query based on the Table above

Select [A],[b], IIf([A] Is Null Or [b] Is Null,0,[A]* [b]) As [C] From
[TableName]

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

I search for an answer on my question without luck, so here goes.

I a form i have a control A, [Lenght1], a control B, [width1], and a control
C [Area1].
What I want this controlers do do is this:
- Calculate the area in control C when fill in values in control A and B
- or write the area direct in control C and set A and B to zero or nothing
if there are values in them
- and have the value area too be shown in the table someway.
How do I do this?

Regards
--
TomH

  #5  
Old December 7th, 2005, 02:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Overwrite a calculated control

Very big thank you and thank you again.

That worked fine. Another happy user.

Regards
--
TomH


Ofer skrev:

In that case bound the C field in the form to the C field in the table.
On the after update event of fields A and B write the code

If not Isnull(Me.A) and not Isnull(Me.B) and Me.A 0 and Me.B 0 then
Me.C = Me.A * Me.B
Else
Me.C = 0
End If
==================================
About the second part, if I understood you, and you want to set A and B to 0
if you enetee value in C , then on the After update event of field C, write
the code
Me.A=0
Me.B=0

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

Thanks for answer.
I do what you mentioned, and half of my questin is answered. The other part
is that I want to write the area directly in control C if I dont know A or B
(this happens from time to time).
Lets say i have an area 10m2, then I want too write 10 in the C controller,
and if there are any values in A or B, I want this to be set to 0 or nothing.

It maybe unsolvable or a dreamwish from me?

--
TomH


Ofer skrev:

Hi Tom
There is no need, and you shouldn't, store the calcuated field in the table.

In the form,you can write in the control source of field C
=IIf([A] Is Null Or [b] Is Null,0,[A]* [b])

To get the resault as a table, create a query based on the Table above

Select [A],[b], IIf([A] Is Null Or [b] Is Null,0,[A]* [b]) As [C] From
[TableName]

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



"TomH" wrote:

I search for an answer on my question without luck, so here goes.

I a form i have a control A, [Lenght1], a control B, [width1], and a control
C [Area1].
What I want this controlers do do is this:
- Calculate the area in control C when fill in values in control A and B
- or write the area direct in control C and set A and B to zero or nothing
if there are values in them
- and have the value area too be shown in the table someway.
How do I do this?

Regards
--
TomH

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculated control in subform footer area jmvc Setting Up & Running Reports 0 July 1st, 2005 08:21 AM
rounding is ignored in calculated control Office User Setting Up & Running Reports 4 June 20th, 2005 10:25 PM
Summing a calculated control in a report Tony Williams Setting Up & Running Reports 6 February 18th, 2005 03:19 PM
Data Entry Mode bdehning Using Forms 17 November 22nd, 2004 04:49 PM
How to assign value to a report control? Peter General Discussion 3 June 29th, 2004 11:17 AM


All times are GMT +1. The time now is 09:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.