Because أَحْمَدَ ends in fatḥa in مَرَرْتُ بِأَحْمَدَ, it should be called accusative.

Munṣarif and Ghayr Munṣarif — Definitions, Causes and Parsing