Environment
SQL-Server 2k tables linked into Access2003SP3 database (DSN-less).
( ! prior version ACC97 stay installed on my machine, must support old
versions ;-( !)
Issue:
A product record has related category stored in a uniqueidentifier typed
field
'Category'coded from 'Categories'- table.
This all displayed in a form.
My question:
How can i reset product category per VBA code ? ( Sub
btnCategoryReset.OnClick)
Me!Category=NULL
statement does throw error 3162 'You tried to assign NULL value
to a variable that is not Variant data type'.
The same for
My!Category.value=NULL.
A vartype (My!Category.value) call returns 8 - also a string.
It sounds like the tblProducts has a Field [Category]
which is a *ForeignKey*, NOT a PK/GUID, linking to the
tblCategories to classify the Product into a particular
category.
If this is the case, you will need to check the design of
the tblProduct (in SQL Server) to see if Null is allowed
for the ForeignKey Field [Category] and whether you have
set R.I. on the relationship between tblCategories and
tblProducts.
It sounds like the tblProducts has a Field [Category]
which is a *ForeignKey*, NOT a PK/GUID, linking to the
tblCategories to classify the Product into a particular
category.
If this is the case, you will need to check the design of
the tblProduct (in SQL Server) to see if Null is allowed
for the ForeignKey Field [Category] and whether you have
set R.I. on the relationship between tblCategories and
tblProducts.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.