Default Value in field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 fields in a Form: Env #, Pledged Amount and Amount Received.
I have used a Value Expression in the Default area of Properties to
automatically show the Pledged amount, which can then be overtyped depending
on the Amount Received. However, the Default amount continues to show zero
for each record, not the Pledged amount as required.
Any help would be appreciated.
 
Hi -

You'll have to provide us with more information than that;

Are you referring to new records (i.e. data entry), or existing ones?
Default value only works with new records.

What is the expression you are using for default value, and what field
is it for?

I'm going to hazard a guess here - the amount received is supposed to
default to the pledged amount, and be filled in when the pledged amount
is filled in. If so, the default value doesn't work - the default value
is filled in when the new record is created by MS Access, so of course
when that happens, the pledged amount is still 0.0.

What you need to do is fill in the Amount Received field (control) in
the after update event of the Amount Pledged, using code like this:

me![amount received] = me![amount pledged]

HTH

John
 
Thanks for that John. As I already have data in the "amount Pledged" field I
have written the following "On Enter" Event Procedure into the field "Amount
received".
Me![amount received]=[amount pledged]

When this field is entered it brings up the amount pledged with no problems
and the amount can be changed. However, when you click through the records
again, the amount received field goes back to the value of the amount
pledged, which I understand why. Is there any way I can avoid this happening?
Many Thanks for your help

J. Goddard said:
Hi -

You'll have to provide us with more information than that;

Are you referring to new records (i.e. data entry), or existing ones?
Default value only works with new records.

What is the expression you are using for default value, and what field
is it for?

I'm going to hazard a guess here - the amount received is supposed to
default to the pledged amount, and be filled in when the pledged amount
is filled in. If so, the default value doesn't work - the default value
is filled in when the new record is created by MS Access, so of course
when that happens, the pledged amount is still 0.0.

What you need to do is fill in the Amount Received field (control) in
the after update event of the Amount Pledged, using code like this:

me![amount received] = me![amount pledged]

HTH

John


Roger said:
I have 3 fields in a Form: Env #, Pledged Amount and Amount Received.
I have used a Value Expression in the Default area of Properties to
automatically show the Pledged amount, which can then be overtyped depending
on the Amount Received. However, the Default amount continues to show zero
for each record, not the Pledged amount as required.
Any help would be appreciated.
 
Hi -

You could use that to initialize the [amount received] control the first
time, and leave it alone afterwards by using:

If me![amount received] = 0 then me![amount received]=me![amount pledged]

The downside is that every time you look at the record for someone who
has not paid anything yet, it will set the [amount received] control if
you tab into it.

Question - is this a situation where the amount pledged might be paid in
several installments (e.g. a church), or will the amount only be
received once (e.g. a telethon)

If the former, then you should think about another table, for payments -
Env#, date, amount.

Your [amount Received] field in the first table would then be the sum of
the amounts in the payments table, for each env#. (And in fact you would
not need the [amount received] field in the first table.)

HTH

John



Roger said:
Thanks for that John. As I already have data in the "amount Pledged" field I
have written the following "On Enter" Event Procedure into the field "Amount
received".
Me![amount received]=[amount pledged]

When this field is entered it brings up the amount pledged with no problems
and the amount can be changed. However, when you click through the records
again, the amount received field goes back to the value of the amount
pledged, which I understand why. Is there any way I can avoid this happening?
Many Thanks for your help

:

Hi -

You'll have to provide us with more information than that;

Are you referring to new records (i.e. data entry), or existing ones?
Default value only works with new records.

What is the expression you are using for default value, and what field
is it for?

I'm going to hazard a guess here - the amount received is supposed to
default to the pledged amount, and be filled in when the pledged amount
is filled in. If so, the default value doesn't work - the default value
is filled in when the new record is created by MS Access, so of course
when that happens, the pledged amount is still 0.0.

What you need to do is fill in the Amount Received field (control) in
the after update event of the Amount Pledged, using code like this:

me![amount received] = me![amount pledged]

HTH

John


Roger said:
I have 3 fields in a Form: Env #, Pledged Amount and Amount Received.
I have used a Value Expression in the Default area of Properties to
automatically show the Pledged amount, which can then be overtyped depending
on the Amount Received. However, the Default amount continues to show zero
for each record, not the Pledged amount as required.
Any help would be appreciated.
 
Back
Top