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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public Variables and Passing Values

Status
Not open for further replies.
Aug 26, 2002
33
US
How do you define a public variable?

And is using public variables the best way to pass values from one form to another? I am trying to take values from one form, create an on the fly query to filter the results, and then pass the values to another results page. I have tried several options, like recordsets, but didn't do it right.

Any suggestions would be very helpful.

Thanks so much!
 
Dim WhereClause as String, LinkCriteria as String

WhereClause = " componentType = " & QUOTE & CBComponentType & QUOTE
DoCmd.OpenForm DocName, , , WhereClause
OR
DoCmd.OpenForm DocName, , , , , , LinkCriteria

You can send data to the Form or Report you are opening by either a filter such as the where clause in the sql statement, or as some data that can be picked up in the opened form by checking Me.OpenArgs.

You can create public variables in the standard module and reference these in the form you opened.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top