V
Vernon
Good morning,
I am attempting to calculate the "Obl Fees" field of my
data entry form by multiplying the "LU_Type" and "Units"
fields of the same form. The only complications are that
the "LU_Type" field is a pull down menu referencing a
table called "tbl_LU_Type" and that the equation is
actually referencing a different column in the table than
what is shown ("LU_Type" is shown, but I am referencing
the "Fee Per Unit" column in my equation).
Using code editor, I have added the following line of
script to the after update fields of both the "LU_Type"
and "Units" fields:
Private Sub Units_AfterUpdate()
If Not IsNull(Me.[LU_Type]) And Not IsNull(Me.[Units]) Then
Me.[Obl Fees] = DFirst("Fee Per
Unit", "tbl_LU_Type", "LU_Type=" & Me.[LU_Type] & "") * Me.
[Units]
End If
"LU_Type" is the first field that gets data entered into
it. Everything goes well there. It is when I enter data
to the second field "Units" that I get the following
error: Run Time Error 3075. Syntax Error (Missing
Operator) in query expression 'first(Fee Per Unit)'.
If anyone could tell me what's going on and how to remedy
it, I would be greatly appreciative.
Thanks,
Kendra
I am attempting to calculate the "Obl Fees" field of my
data entry form by multiplying the "LU_Type" and "Units"
fields of the same form. The only complications are that
the "LU_Type" field is a pull down menu referencing a
table called "tbl_LU_Type" and that the equation is
actually referencing a different column in the table than
what is shown ("LU_Type" is shown, but I am referencing
the "Fee Per Unit" column in my equation).
Using code editor, I have added the following line of
script to the after update fields of both the "LU_Type"
and "Units" fields:
Private Sub Units_AfterUpdate()
If Not IsNull(Me.[LU_Type]) And Not IsNull(Me.[Units]) Then
Me.[Obl Fees] = DFirst("Fee Per
Unit", "tbl_LU_Type", "LU_Type=" & Me.[LU_Type] & "") * Me.
[Units]
End If
"LU_Type" is the first field that gets data entered into
it. Everything goes well there. It is when I enter data
to the second field "Units" that I get the following
error: Run Time Error 3075. Syntax Error (Missing
Operator) in query expression 'first(Fee Per Unit)'.
If anyone could tell me what's going on and how to remedy
it, I would be greatly appreciative.
Thanks,
Kendra