Override calculated field

G

Guest

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?
 
G

Guest

if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
 
G

Guest

It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.
 
G

Guest

Instead of binding it to the calculation, either set its default value as
Shipped_Date + 30 (if Shipped_Date will be populated when the form is
opened), or put this in Shipped_Date_AfterUpdate.

Private Sub Shipped_Date_AfterUpdate()
YourControl = Shipped_Date + 30
End If

This way, the value gets set to Shipped_Date + 30 when the Shipped_Date is
changed, but the user can override because it is not bound to a calculation.

alaskahawk said:
It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.

NetworkTrade said:
if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
 
F

fredg

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?

Your question is not very clear.
If my guess is correct, leave the control source of the calculated
shipped date + 30 blank.
Code the AfterUpdate event of the [ShippedDate] field:
Me![ShippedPlus30] = Me![ShippedDate] + 30

This value should NOT be saved in any table.
 
G

Guest

Okay that kinda worked...it calculated fine and I was able to override it but
now each of the other records shows the new override date...???

Brian said:
Instead of binding it to the calculation, either set its default value as
Shipped_Date + 30 (if Shipped_Date will be populated when the form is
opened), or put this in Shipped_Date_AfterUpdate.

Private Sub Shipped_Date_AfterUpdate()
YourControl = Shipped_Date + 30
End If

This way, the value gets set to Shipped_Date + 30 when the Shipped_Date is
changed, but the user can override because it is not bound to a calculation.

alaskahawk said:
It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.

NetworkTrade said:
if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
--
NTC


:

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?
 
G

Guest

Except if the override is there to allow the user to change it from the
default in some particular case. One would assume that such a variance should
be saved with the record if it is to be retreived later. Otherwise, why
override?

fredg said:
I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?

Your question is not very clear.
If my guess is correct, leave the control source of the calculated
shipped date + 30 blank.
Code the AfterUpdate event of the [ShippedDate] field:
Me![ShippedPlus30] = Me![ShippedDate] + 30

This value should NOT be saved in any table.
 
G

Guest

Are you storing the calculated value, or is this an unbound control? If you
are not storing it, it will not be retrieved the next time you open the
record, and I'm not sure what the purpose of an override would be.

alaskahawk said:
Okay that kinda worked...it calculated fine and I was able to override it but
now each of the other records shows the new override date...???

Brian said:
Instead of binding it to the calculation, either set its default value as
Shipped_Date + 30 (if Shipped_Date will be populated when the form is
opened), or put this in Shipped_Date_AfterUpdate.

Private Sub Shipped_Date_AfterUpdate()
YourControl = Shipped_Date + 30
End If

This way, the value gets set to Shipped_Date + 30 when the Shipped_Date is
changed, but the user can override because it is not bound to a calculation.

alaskahawk said:
It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.

:

if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
--
NTC


:

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?
 
J

JethroUK©

you need to get rid of the calculated field and replace it with a proper
field in your table - that field needs be bound to a textbox on your form -
now let the form calculate the contents of this textbox (as per brians
solution) unless you override it



alaskahawk said:
Okay that kinda worked...it calculated fine and I was able to override it but
now each of the other records shows the new override date...???

Brian said:
Instead of binding it to the calculation, either set its default value as
Shipped_Date + 30 (if Shipped_Date will be populated when the form is
opened), or put this in Shipped_Date_AfterUpdate.

Private Sub Shipped_Date_AfterUpdate()
YourControl = Shipped_Date + 30
End If

This way, the value gets set to Shipped_Date + 30 when the Shipped_Date is
changed, but the user can override because it is not bound to a calculation.

alaskahawk said:
It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.

:

if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
--
NTC


:

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?
 
G

Guest

Thanks for everyone's assistance -- this solution worked for my situation.

JethroUK© said:
you need to get rid of the calculated field and replace it with a proper
field in your table - that field needs be bound to a textbox on your form -
now let the form calculate the contents of this textbox (as per brians
solution) unless you override it



alaskahawk said:
Okay that kinda worked...it calculated fine and I was able to override it but
now each of the other records shows the new override date...???

Brian said:
Instead of binding it to the calculation, either set its default value as
Shipped_Date + 30 (if Shipped_Date will be populated when the form is
opened), or put this in Shipped_Date_AfterUpdate.

Private Sub Shipped_Date_AfterUpdate()
YourControl = Shipped_Date + 30
End If

This way, the value gets set to Shipped_Date + 30 when the Shipped_Date is
changed, but the user can override because it is not bound to a calculation.

:

It is on a form and it "Lock" is already set to "No" -- it says field cannot
be edited because it is bound by "=[Shipped_Date]+30" -- any other ideas?

Thanks.

:

if we are talking about a Form ; then one should be able to simply type over
it with a new value - unless it is locked. To turn off the lock one would
put the form in design view, right click on that box, go to Properties, and
scan down the list until you find 'Lock" and change that to 'no'....

but if this isn't a Form then can't say until it is better understood......
--
NTC


:

I have a shipped date field and a calculated field of shipped date plus 30
days, how can I make this calculated field overrideable by the user if they
need to change it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top