I need my form – frmFinance – to automatically select between two different values depending on what value is in another txt box. However, sometimes this value needs to be manually edited (in very rare cases, say less than 5% of the time).
frmFinance is based on a qry; qryFinance. This pulls together the relevant fields from tblBookings and tblFinance.
If the Language field has BSL in it, the default value would be 70. Anything other than BSL in the Language field and the value would be 50.
I tried using an IIF statement, and this worked fine, until I discovered I could not edit the value when I need to change it, because it was bound to the IIF statement.
This was the IIF statement:
The above code was entered as the Control Source for txtSUCharge on frmFinance.
I then did some googling and it looked like DLookUp would do what I want:
I also tried:
Again, this was inputted into the same place as the IIF statement. However, the behaviour was the same. It would not let me manually change the value of txtSUCharge if need be.
Any ideas? I did try to do the IIF in VBA, but that didn’t work either.
frmFinance is based on a qry; qryFinance. This pulls together the relevant fields from tblBookings and tblFinance.
If the Language field has BSL in it, the default value would be 70. Anything other than BSL in the Language field and the value would be 50.
I tried using an IIF statement, and this worked fine, until I discovered I could not edit the value when I need to change it, because it was bound to the IIF statement.
This was the IIF statement:
Code:
=IIf([Language]="BSL",70,50)
I then did some googling and it looked like DLookUp would do what I want:
Code:
=DLookUp("[tblFinance].[SUCharge]","[tblFinance]","[tblBookings].[Language]")
I also tried:
Code:
=DLookUp("[tblFinance].[SUCharge]","[tblFinance]","[tblBookings].[Language]='BSL'")
Again, this was inputted into the same place as the IIF statement. However, the behaviour was the same. It would not let me manually change the value of txtSUCharge if need be.
Any ideas? I did try to do the IIF in VBA, but that didn’t work either.