Dear student,
Formic acid, a component of ant venom and we know that vinegar is made-up of acetic acid so it can't be used for the treatment of ant stings. On the other hand wasps venom is basic in nature and can be neutralised by applying vinegar.
Regards