In order to fit within the context of the preceding verses, “dreams” in verse 7 does not mean the random mental activity a person has while sleeping and over which he has little or no control. Rather, it indicates the wanderings of a person's mind while seemingly fully awake—in other words, daydreams. For the most part, daydreams are nothing but sheer vanity, time-wasting drifts of the mind that lead nowhere positive. While daydreaming, we are not focused and disciplined, which is the opposite of what God desires of us.
Something else is of interest here. This verse contains both the major concepts that the book begins with, that is, vanity, and the thought or goal the book ends with, “Fear God and keep His commandments, for this is the whole duty of man.” Halfway through the book, Solomon is directly declaring what the urgent aim of every life needs to be. We need to proceed from the meaninglessness of an under-the-sun life to the fulfillment of life's purpose through fearing God, as shown in living an over-the-sun life.
The way to get and stay right with God is encapsulated in these seven verses. It can be stated in three simple principles:
1. Do not just hear God; listen to Him carefully with focused attention.
2. Speak with a matching level of focused attention.
3. Follow through in obedience to what we vowed when we committed ourselves to making the New Covenant.
A tension exists in what Solomon counsels us regarding our relationship with God. Though we may not think of it all the time, we understand that, for our own good, God demands our highest allegiance. We willingly accept that because we believe the gospel, knowing who He is and what He offers us. However, being human, we are sometimes easily distracted. There are times that we would rather do almost anything else short of an outright sin than to listen attentively to what God says.
John W. Ritenbaugh
Ecclesiastes and Christian Living (Part Six): Listening