Sometimes I ask a question suited to my problem.
When it gets answered I know what happened and what the problem is.
So is it preferred to edit the question so it will apply to more questions people (may) ask?
If somebody provided (correct) answer and, coincidentally, you've discovered the same solution at the same time, I see no problem with accepting/upvoting that answer.
If posted answer is not the best, you can always post your own solution as an answer.
But I'm not sure that changing your question after it got answered is such a great idea. Especially, when you've found solution already.
In general, I think you should ask questions that are important for you, not the questions "people (may) ask".
No. Personally, I dont think so. When a question gets answered, it is specifically for that question. If you edit your question and make it generic, then the answer might not still be valid for the generic case. It would give wrong indication to the users who visit the question after you edit.
Given, if the edit of making the question generic does not make the accepted answer invalid, you can edit, but with a note below your original question.