The error message mean that
tblCategories.Columns("CategoryID")
is not the expected object.
Use the debugger to see what append.
Make sure the column exist.
Quote:
CategoryID column exists in Category Table.
Yes but you open a table named
Categories
.
[Update]
Use the debugger to make sure the database opens correctly.
Use the debugger to know where is the fail.