0

I want to use the DCount function in my Visual Studio Project but DCount gets underlined with a squiggly line and the tooltip says "Not declared" What is the solution?

1 Answers1

0

I don't know which language you are using in Visual Studio (I suspect VB.NET), but DCount is not available neither VB.NET nor C#, it is an Access VBA function. It can't be used in SQL queries either, when you want to retrieve data from Access.

You can count the number of records however by using a SQL expression like
SELECT COUNT(*) FROM ExampleTable WHERE FieldToCount = 'SpecificSelection'
or using LINQ.

Bouke
  • 1,531
  • 1
  • 12
  • 21