Field2 Value based on Field1 Input

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

Guest

Hiya

I've got a form like this:

ExpenseType (Combo) - Bound to T-ExpenseReports
DollarAmount (Text) - Unbound

I want to make it so that when
Expense.Value = "Per Diem"
DollarAmount.Value = "65"

So I put an Event Procedure in ExpenseType's AfterUpdate option and wrote
the code like this:

If Expense.Value = "Per Diem"
DollarAmount.Value = "65"
EndIf

I get no result wether I type "Per Diem" or "per diem" or anything in
between. I'm guessing this has something to do with either Field Types or a
glitch in the matrix.

Any suggestions?

/amelia
 
If you have this code on the after update of Expense field it should work
to be on the safe side put a code break in the first line, to see if the
after update enter the code, and second check the value of Expense to see
what you geting.
also amount field is usualy a number, and you trying to asign a text to it

If Expense.Value = "Per Diem" then
DollarAmount.Value = 65
End If
 
heh heh

If you scroll down, you'll see that's what i came up with originally. however

the problem was simple: "Per Diem" was item number 5 in my table of
ExpenseCodes and the script was looking for "5" not "Per Diem"

thanks tho!
 
So we've got it working, but we've (Not surprisingly) encountered a whole new
set if worries:

This is a subform and when the "Per Diem" case is applied to a record's
USDAmount field, _All_ of the USDAmount fields in the table are changes since
their names are also USDAmount.

Makes perfect sense.

So how do i only affect the USDAmount for that one record?
 
Back
Top