# Why does AMPL reject my “let” statement with a “… has a := value in the model” message?

**URL:** <https://discuss.ampl.com/t/why-does-ampl-reject-my-let-statement-with-a-has-a-value-in-the-model-message/70>\
**Category:** FAQs\
**Tags:** errors-and-messages\
**Created:** [December 15, 2021, 5:56pm UTC](https://discuss.ampl.com/t/why-does-ampl-reject-my-let-statement-with-a-has-a-value-in-the-model-message/70 "2021-12-15T17:56:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![megrobert](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@megrobert](https://discuss.ampl.com/u/megrobert)\
**Post date:** [December 15, 2021, 5:56pm UTC](https://discuss.ampl.com/t/why-does-ampl-reject-my-let-statement-with-a-has-a-value-in-the-model-message/70/1 "2021-12-15T17:56:54Z")

</div>

Your `let` command is attempting to assign a value to some set or parameter. In the set’s or parameter’s declaration, however, you have used a `:=` phrase to permanently define the value. A `let` command is not permitted to redefine the value of such a parameter; hence the error message that you received.

As an example, if the model declares

```auto
param dstot {p in prod} := sum {w in whse} ds[p,w];

```

then `dstot[p]` is permanently defined to take the value `sum {w in whse} ds[p,w]` . You can make any changes you like to the `ds[p,w]` values, and AMPL will automatically change the `dstot[p]` values accordingly. Any command beginning `let {p in prod} dstot[p] := ...` will be in error, however.

If you want to be able to use `let` to override the defined value of a parameter, use `default` in place of `:=` in your `param` declaration.
