Override default value sourced via Dlookup?

C

CW

I have a Quotes table and form, and a Costing form which is based on the
CostsActual table.
On the Costing form I want the various components of our costs to display
the quoted amounts by default, but if these have actually come out different
once we have done the job then the user needs to be able to override the
figures and enter the actual costs.
The source of each Cost control is the relevant field in the CostsActual
table.
In the Default Value properties of these controls I have used DLookup to
pull the quoted costs from the Quotes table and that's fine. However,
although they show as Enabled Yes and Locked No, we cannot overwrite the
displayed amounts.
Am I asking too much, to be able to show a value pulled from one source by
default, but then overwrite it with another value that is input by the user
and which writes to a different table (albeit the table which is the source
for the form)?
Thanks for any suggestions!
CW
 
L

Linq Adams via AccessMonster.com

A Default Value can be overwritten by manually entering new data, so you
shouldn't be having a problem. On the other hand, setting the Control Source
to something, like a value retrieved using DLookup(), cannot be overwritten.
First thing I'd do is look at the Control Source and make sure you didn't
place something there during the development process and forget to remove it.

Is the form updatable, i.e. can you enter and save other data?

Other than that, based on the facts you've given, I'd have to lean towards
corruption of some sort.
 
C

CW

Many thanks for your prompt reply...yes I do have the Control Sources set,
they point to the relevant fields in the CostsActual table.
That's cos the way I want it to work, users will initially (by default) see
the quoted amounts which are being pulled from the Quotes table. But if the
actual amounts have come in different, they need to input those and have them
stored in the CostsActual table. In this way, we can work out variances
between amounts allowed for within our quotes (stored in the Quotes table and
not overwritten) and the actual cost amounts (newly stored in the CostsActual
table).
Hope this clarifies what I'm trying to do, and why. The question now is, HOW
?!
Thanks again
CW
 
B

Bob Quintal

Many thanks for your prompt reply...yes I do have the Control
Sources set, they point to the relevant fields in the CostsActual
table. That's cos the way I want it to work, users will initially
(by default) see the quoted amounts which are being pulled from
the Quotes table. But if the actual amounts have come in
different, they need to input those and have them stored in the
CostsActual table. In this way, we can work out variances between
amounts allowed for within our quotes (stored in the Quotes table
and not overwritten) and the actual cost amounts (newly stored in
the CostsActual table).
Hope this clarifies what I'm trying to do, and why. The question
now is, HOW ?!
Thanks again
CW
Are other fields in the form editable? The form itself can be
locked, by setting the allow_edits property to No.

Are you perhaps using a query to reference the table to the form.
Some queries are read only, If it's a query, can you edit the data
directly in the query?
 
L

Linq Adams via AccessMonster.com

Sorry, but you're not paying attention!!!.My first post told you how!

If you have the ***Default Value*** set using the DLookup() on your table,
you ***can*** later change the value!

If you have the ***Control Source*** set using the DLookup() on your table,
you ***cannot*** later change the value!

So move your DLookup() from the Control Source to the Default Value, and you
should be set!
 
C

CW

OK thanks, I'm clear about what you're saying.
What I have is a combination of both.
On each of the Cost controls the Default Value is set to a DLookup in the
Quotes table, and at the same time the Control Source is set to a field in
the CostsActual table. The source for the form is that table itself, it's not
via a query.
So, should it be feasible for us to overwrite the displayed default value
and write the desired new amount to the CostsActual table? It's not possible
as it stands now.
Thanks
CW
 
C

CW

Bob, thanks for your suggestions...yes, all other controls on the form are
editable, it's just those that have their Default Value set to DLookup that
are giving the trouble. And yes, the Allow Edits property is set to Yes. And
no, I'm not using a query as the source for the form, it's based directly
upon the CostsActual table.
I wonder if you have any further thoughts...?
Many thanks
CW
 
B

Bob Quintal

Bob, thanks for your suggestions...yes, all other controls on the
form are editable, it's just those that have their Default Value
set to DLookup that are giving the trouble. And yes, the Allow
Edits property is set to Yes. And no, I'm not using a query as the
source for the form, it's based directly upon the CostsActual
table. I wonder if you have any further thoughts...?
Many thanks
CW
First, test to see if removing the default value lets you edit those
controls. If removal allows editing, try a static value in the
default value.

if it is the dlookup causing the problem a workaround is to set the
values using some code in thte before insert event of the form.
 

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