A few comments;
It is _never_ good practice to use a Reserved Word ("Filter", in this
case) as the name of a field or control. At best, this will almost
inevitably cause confusion; at worst, it can result in very hard to
find bugs.
It is not clear to me how the value of your Option Group actually
filters your records. If you have code in the AfterUpdate Event for
the Option Group to apply the appropriate Filter (in the Access
sense!) depending on which option is selected, which is how I would
probably do it, and this code is also storing the appropriate value in
the CorS field, just changing the value in the CorS field from other
code will obviously not change the Filter setting. Having said this,
however, your existing code should be doing what you expect unless the
use of the reserved name is screwing things up.
Do you have any other Form Event code (Form_BeforeUpdate,
Form_AfterUpdate, Form_Current) which may be firing when you go to the
New Record and screwing you up?
Hi
Actual code is:
I'm not sure if that makes it any clearer but what I do is
filter the records on a form to show only relevant records
Ie. Customers, Suppliers etc which are stored in the same
table. (I could have separate forms for suppliers and
customers but I hate having to go to a new form or table
just to get a phone number) I filter the records with an
option group called "Filter" whos values are 1 for Sales
and 2 for suppliers depending on option selected. The
values 1 or 2 are stored in CorS field. But it is common
when entering new contact details in a new record to
forget to enter the values 1 or 2 that diferenciate
between Customer and Supplier in the CorS field. If I
could automatically enter the value from the filter field
into the CorS field of a new record this could be avoided.
Any help?
Dim CopyValue As Integer
CopyValue = IntOldFieldValue
Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher