I am trying to return a single record from an Access table but I am struggling to return the specific record
I have been using
but this returns all the records in the table.
When I have reduced the query down to
it is still returning all the records despite there only being a few in the table.
I can't work out what isn't right as I use this command quite a lot.
Thanks
I have been using
Code:
strQuery = "SELECT Agent FROM SageData WHERE InvDate = #" & Format(dtDate, "dd/mm/yyyy") & "# AND BoxRef = '" & rngCell.Offset(intCount, 0) & "'"
rsQuery.Open "SageData", cnConnection, adOpenKeyset, adLockOptimistic
When I have reduced the query down to
Code:
strQuery = "SELECT Agent FROM SageData WHERE Supplier = 'CNG'"
I can't work out what isn't right as I use this command quite a lot.
Thanks