Passing parameters between forms

  • Thread starter Thread starter Simon Webb
  • Start date Start date
S

Simon Webb

I have a form which is used to generate a string.

This string is an SQL query which is the record source for a second form.

Is there a way that I can pass this string from the first form to the second
form when the second form is opened within the first form. At the moment I
use a public variable, but for other reasons I think this is quite a risky
approach.

Thanks in advance

simon
 
Simon,

You can use the OpenArgs argument of the OpenForm method when you open
the second form, and then use code on the Open event of the second form
like this...
Me.RecordSource = Me.OpenArgs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top