Redefine a field "default value"

  • Thread starter Thread starter Paulo Ferreira
  • Start date Start date
P

Paulo Ferreira

Can someone tell me how to redefine a field "default value", based on a
value that is writen on that field (or another) on a form?
Thanks.

Paulo Ferreira
 
Paulo

I believe you can use code something like (untested aircode follows, your
syntax may vary):

Me!txtMyTextControl.DefaultValue = whatever you want to set it to
 
Not working.
When I click for a new record, that field show "#Name?".
Can you help me on it.
Thanks.

Paulo Ferreira
 
Hi

I have use a continuous form. and in the form header I put an unbound text
box that i named
Choice so I have the field [Choice]

On the continous for I have a field [Price] which default vlue is set to 15

So I put a button in the form header and on the onclick command I put the
following code

[Price].Defaultvalue = [Choice]


So if I put 25 in the [Choice] textbox, if i click the default value for
[Price] change for 20
 
Paulo

When a form displays "#Name", it's trying to tell you that something is
misspelled, and that it doesn't understand.
 
You are right Jeff, the " are missing. Now i can use
"Me!txtMyTextControl.DefaultValue = whatever you want to set it to", but the
change is only temporary. If I exit the form and open it again, I get the
same old default value.
Can you give me some more help?
Thanks.

Paulo Ferreira
 
Paulo

You wanted a way to change a default value of a control while you were using
a form. How will your form "know" that the default value should be a
permanent change, rather than a change during a session?

If your underlying table has a default value, I suspect the default reverts
to that value between sessions.

Good luck

Jeff Boyce
<Access MVP>
 
You are right.
Thanks anyway.

Paulo Ferreira



Jeff Boyce said:
Paulo

You wanted a way to change a default value of a control while you were
using
a form. How will your form "know" that the default value should be a
permanent change, rather than a change during a session?

If your underlying table has a default value, I suspect the default
reverts
to that value between sessions.

Good luck

Jeff Boyce
<Access MVP>
 
No need to quit, if you are determined to change the default permanently.
You could delete the table default value and give your form a try...

Jeff Boyce
<Access MVP>
 
Back
Top