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
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