Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing vairiables or Using a Global

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Hey,

Hopefully this won't confuse but, I currently have 2 Forms, One with checkboxes and a date search, and the other displays a query based on that search.

Now when I select a load of check boxes and enter a date this produces an SQL statement depending on whats been selected. Now first I saved the statement in SqlStr. in form 1 to be passed to form two, I also changed the record source of form2 to SqlStr, when Form1 loads Form2 it recognises that Form2 has not been passed the SqlStr yet. So I thought I change the settings At runtime, by changing the recordset back to the original query, and when the form loads setting the recordset then, But I can not get SqlStr to pass from Form1 to Form 2!

I have tried creating a global but it comes up with the following error...

Dim SqlStr as Global

"Expected: New Or Type Name"

I have also tried referencing like this

SqlStr = Form_FormMyName.SqlStr but that doesn't work, so my question is either...

How do you declare a global variable, or how do you reference variables from form to form?

Thanks For Any Help

Sam
If

Dim SqlStr as global
 
Hey,

Ignore this post, It was early in the morning and I didn't have my head screwed on properly, it is all sorted, thanks,

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top