Use derived field value to update table field

  • Thread starter Thread starter Brown
  • Start date Start date
B

Brown

Using Access 2003 on WinXP Pro platform.
I have a combo box on a form (List of field office cities).
I have another field whose Control Source (IIF) value is derived from the
cities field.
I need this value posted to a field in a table. I thought I had done this
before, but I have apparently done a brain wipe. Would someone be kind
enough to give me a gentle kick in the right direction?

Brown
 
As the IIF field is not bound (you cannot bind calculated fields), you will
need to update the field manually. You can use the AfterUpdate event of the
combo box to do this:

Me![FieldName] = Me![IIF textbox name]

Even better, you could bind the textbox to the underlying field and set its
value in the AfterUpdate event:

Me![Bound textbox name] = IIf( ..... )
 
Thanks Graham,
The latter is what I used before---
Having a Senior moment I guess,

Brown

Graham Mandeno said:
As the IIF field is not bound (you cannot bind calculated fields), you will
need to update the field manually. You can use the AfterUpdate event of the
combo box to do this:

Me![FieldName] = Me![IIF textbox name]

Even better, you could bind the textbox to the underlying field and set its
value in the AfterUpdate event:

Me![Bound textbox name] = IIf( ..... )

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brown said:
Using Access 2003 on WinXP Pro platform.
I have a combo box on a form (List of field office cities).
I have another field whose Control Source (IIF) value is derived from the
cities field.
I need this value posted to a field in a table. I thought I had done this
before, but I have apparently done a brain wipe. Would someone be kind
enough to give me a gentle kick in the right direction?

Brown
 
Back
Top