Auto populate

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

I have a field [fee] that I would like to have populated
automatically $100 when the [completdate] is entered how
I would do this using code?
Thanks
 
I doubt this is the easiest way of doing it but it certainly i
versatile. Assuming you're working on a form...se the 'on exit
property of the [datecompleted] field with a macro using the SetValu
action. The item would be the [fee] field and the expression woul
simply be "$100"

avalon_to
 
Raj,

The idea suggested by Avalon should work ok, except that assuming your
Fee field is a currency or number data type, the Expression argument of
the SetValue action would be 100 not "$100". Also, I would use the
AfterUpdate event of DateCompleted rather than the Exit event. And you
would also need a Condition in the macro like this...
[DateCompleted] Is Not Null

You can also do this in a VBA procedure, similarly on the AfterUpdate
event of DateCompleted, which would look a bit like this...
If Not IsNull(Me.DateCompleted) Then
Me.Fee = 100
End If
 
Back
Top