How to enter data into a pre-set calculated fild?

cos

Registered User.
Local time
Today, 19:07
Joined
Jul 13, 2012
Messages
81
I have three filds:
1 a standart entry box
2 a tick box (Yes/No data type)
3 the calculated txt box { =IIf([tick box]="Yes",[standart box],Null) }

when the tick box is on "Yes", the text from 1 goes in 3, but when the tick box is not on "Yes", i.e."No", I want to be able to type something into it, yet it will not lt me (thinking because its data type i calculation).


i know im not amazing at describing, but, is there any way to fix this? or an alternative method? :confused:

Much apriciated!!
 
Have you placed the DefaultValue of the field to be based on the CheckBox? If so that should allow you to edit, unless you hvae the Form/Field Locked from editing..

In a totally irrrelavent subject have you considered using VBA to achieve this?
 
this is what it shows when i place it as a default value in a text datatype field... and using the "If" statement in the calculated datatype will ither give meoneresult or another, not allwing me to type anything in..

and no, i never used VBA and i have no idea what it is or how to use it =/

so how do you think i can tackle this? :confused:
 

Attachments

  • error 10.png
    error 10.png
    92.7 KB · Views: 123
Hi cos, I do not think you can do that on a table level (NOT THAT I AM AWARE OF), but is defenitely possible through forms/vba. By my understanding, the DefaultValue Criteria is not even set there, which means it still should allow you to write something.
 
can you plese describe how i can achive what i am trying to do by using the forms/vba as you say you are confident that there's a way which should work?:)
 
All you need to do is create a Form which can be done through the Form wizard.. Then you can use the Default value of the field on the form to get the value, as you have done before. i.e use the IIF statement..

Or you can use VBA, which might be a bit more complicated, Use the same If condition inside the Form current property.
 
is there an expresion whichmans enter value? so that i culd put that in the last part of my IIf statement?
 
is there an expresion whichmans enter value? so that i culd put that in the last part of my IIf statement?
Sorry I did not quiet catch what you mean by "whichmans"
 
is there an expresion whichmans enter value? so that i culd put that in the last part of my IIf statement?

sorry, my keyboard is like a billion years old.. i ment "is there an expresion which means: enter value?"

and where and how am i to use that code which Pat Hartman provided?
 
Hi, what I have given you is a Default value. But, what Pat has given you is for you to change values based on the click of the check box. look at the following attachement.
Once you are in the code builder you will have to copy Pat's code and replace it with your fields names.

If you want to place a text, instead of false, you have to just replace Null with "Enter a Value"
 

Attachments

  • checkThis.png
    checkThis.png
    77.3 KB · Views: 123
sorry, my keyboard is like a billion years old.. i ment "is there an expresion which means: enter value?"
No there isn't.
and where and how am i to use that code which Pat Hartman provided?
She said:
Pat Hartman said:
In the AfterUpdate event of the tickbox:
And by that she means for a checkbox that is on a form and is bound to that yes/no field. And you put the code in the event in the VBA Window and not in the event property. See here for an explanation of what I mean when I say VBA Window:
http://www.btabdevelopment.com/ts/eventcode

You will need to change the field from a Calculated field (if using Calculated in the table then nothing will be able to be entered at all. It is calculated. You need to change it to the appropriate datatype (text, number, currency, etc.).
 
Thanks a lot pr2-eugin!! it actually worked!! :)
however i do have another little problem which i will post in another thread..

Many thanks,
Cos
 

Users who are viewing this thread

Back
Top Bottom