From: oldblindpew on
I am using a combo box to pick a value for a foreign key. The foreign key
field (long integer type) starts out empty, and then is populated via the
combo box. Later, wanting to reverse the selection and depopulate the field,
I select and delete the contents of the combo box. When I move off the combo
box Access says:

"You tried to assign the Null value to a variable that is not a Variant data
type."

How do I empty this field?

Pew
From: Jeanette Cunningham on
Try undoing the record, or you may need to delete that record.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"oldblindpew" <oldblindpew(a)discussions.microsoft.com> wrote in message
news:8B85494D-38E6-4613-BD1A-ED3024A5464E(a)microsoft.com...
>I am using a combo box to pick a value for a foreign key. The foreign key
> field (long integer type) starts out empty, and then is populated via the
> combo box. Later, wanting to reverse the selection and depopulate the
> field,
> I select and delete the contents of the combo box. When I move off the
> combo
> box Access says:
>
> "You tried to assign the Null value to a variable that is not a Variant
> data
> type."
>
> How do I empty this field?
>
> Pew


From: oldblindpew on
It does not seem practical to delete the entire record just to clear one field.

"Jeanette Cunningham" wrote:

> Try undoing the record, or you may need to delete that record.
>
>
> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
>
> "oldblindpew" <oldblindpew(a)discussions.microsoft.com> wrote in message
> news:8B85494D-38E6-4613-BD1A-ED3024A5464E(a)microsoft.com...
> >I am using a combo box to pick a value for a foreign key. The foreign key
> > field (long integer type) starts out empty, and then is populated via the
> > combo box. Later, wanting to reverse the selection and depopulate the
> > field,
> > I select and delete the contents of the combo box. When I move off the
> > combo
> > box Access says:
> >
> > "You tried to assign the Null value to a variable that is not a Variant
> > data
> > type."
> >
> > How do I empty this field?
> >
> > Pew
>
>
> .
>
From: oldblindpew on
I think I've fixed this problem. I don't really understand it, but I
discovered I had included an extra table in my subform's Record Source. I
deleted this table, and now I can freely use my combo box to choose a foreign
key value, or change my mind and delete the value without resulting in any
cryptic messages about trying to assign the Null value to a variable that is
not a Variant type.

"oldblindpew" wrote:

> It does not seem practical to delete the entire record just to clear one field.
>
> "Jeanette Cunningham" wrote:
>
> > Try undoing the record, or you may need to delete that record.
> >
> >
> > Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
> >
> > "oldblindpew" <oldblindpew(a)discussions.microsoft.com> wrote in message
> > news:8B85494D-38E6-4613-BD1A-ED3024A5464E(a)microsoft.com...
> > >I am using a combo box to pick a value for a foreign key. The foreign key
> > > field (long integer type) starts out empty, and then is populated via the
> > > combo box. Later, wanting to reverse the selection and depopulate the
> > > field,
> > > I select and delete the contents of the combo box. When I move off the
> > > combo
> > > box Access says:
> > >
> > > "You tried to assign the Null value to a variable that is not a Variant
> > > data
> > > type."
> > >
> > > How do I empty this field?
> > >
> > > Pew
> >
> >
> > .
> >