مَرَرْتُ بِأَحْمَدَ: Aḥmad is genitive, marked by fatḥah because it is a diptote without al- or iḍāfah.
مَرَرْتُ بِأَحْمَدِكُمْ: Aḥmad is genitive, marked by kasrah because it is in iḍāfah.
Genitive is a grammatical case; fatḥah and kasrah are possible case signs in the relevant contexts.