I’m not 100% sure on this but I guess you could do this in a couple of ways. The first one being if your data is sent from the form using POST then you could check for the existence of such data with say a hidden field to see if the form was sent or not. I say a hidden field as otherwise you may have a form where people don’t have to fill all the fields in and they just might not fill in the one you are checking against 
The other way although one which people could abuse if they know it would be to send along (depends on what you are using to create your form) a success message tagged onto the end of the URL in the last segment. You could then use a simple {if} structure to see if that word is in the URL or not, so something like this :
Submitted Form
http://www.example.com/samples/thankyou
{if segment_2 == "thankyou"}
<p>Show code here</p>
{if:else}
<p>Sorry please fill out the form by visiting this page here - insert link</p>
{/if}
You could probably also save either a cookie or a session variable on page exit to do the same sort of thing if you are worried about people knowing that will be in the URL and visiting the page without it.
Hope that helps.
Best wishes,
Mark