Type Declaration Error

  • Thread starter Thread starter Austin Bike
  • Start date Start date
A

Austin Bike

I am trying to insert an "after update" function that will multiply
some fields together and output the results to another field.

I currently use this and it works:

Private Sub Probability_BeforeUpdate(Cancel As Integer)

Me.Factored_Revenue = Me.Revenue * Me.Probability
End Sub

But when I try to do the same to get factored margin, I get the
following message:

Compile error:

Type-declaration character does not match declared data type

Here's the function:


Private Sub MARGIN_AfterUpdate()
Me.MARGIN$ = Me.MARGIN * Me.Revenue * 0.01
End Sub

Margin$ (margin dollars), type is currency
margin type is general number
MARGIN type is currency

My fear is that putting the $ on margin$ is causing the problem. If
that is the case, this is going to be a mess because that field is
tied to a bunch of external data pulls.

Anyone have any ideas?
 
Hi,
Well, something is not named correctly.
When you type in "Me." do you get
Margin_dollars and Revenue as choices from
inteli-sense?
 
are the other controls wich hold the data for your formula ever getting
changed later on ?
if not there is no reason to store the calculated field,
the basic data can always be called upon in queries or reports to recreate a
calculated value

grtz
 
Back
Top