I've come across this situation a few times, and I'm not sure what to make of it. A user will post a question, often there is a bug in his code that he cannot find. Someone, perhaps multiple people, post answers addressing the problem. Then, the user takes that information, fixes his code, and posts the revised now-working version as an answer. This often happens with newer users.
Here are recent (past 24 hours) examples:
Check of property type in Google App Engine model (see this answer)
How can I get Facebook Profile image from email? (see this answer)
jQuery UI Sortable and Cookie (see this answer)
Process.Start opens too many browsers in XNA game (see this answer)
When is this approach, using answer to fix and posting working code, appropriate? Always? Never? Only if ...? Should these answers be flagged for moderator attention? Should one leave a comment to the OP, and, if so, to what effect?