Here's an easy one for you....How do I refer to a specific record in a table when in VB? For instance, I want to set a variable in code equal to the top seller in a product line (which can change daily). So, let's say I have a sales table (tblSales), I want my variable (TopSeller) to equal the product with the highest sales. I want to do something like this (which isn't working):
Set TopSeller = "SELECT TOP 1 tblSales.Product FROM tblSales ORDER BY tblSales.Sales DESC;"
I am a VB beginner, but I can usually hack my way through and am having trouble with this. Thanks!
D
Set TopSeller = "SELECT TOP 1 tblSales.Product FROM tblSales ORDER BY tblSales.Sales DESC;"
I am a VB beginner, but I can usually hack my way through and am having trouble with this. Thanks!
D