dim DocName as string, LinkCriteria as string
DocName = "MyForm"
LinkCriteria = "the criteria I want to pass"
'- for example a key to search on
DoCmd.OpenForm DocName, , , , , , LinkCriteria
In the Form being opened in the OnOpen event
dim mySQL as string
mySQL = "Select * from mytable where mycriteria = " _
& me.OpenArg
me.recordsource = mySQL
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.