How can I pass a value to a subForm?
I have a subForm (subFollowUp) on my main form (frmTickler). I would like to be able to pass a value to my subform so that only certain records are displayed in the Subform.
The default Record Source for subFollowUp is "SELECT * FROM Projects;".
I'd like to be able to have the Record Source be something like "SELECT * FROM Projects WHERE PManager = 'JOHN DOE';" , depending on what the user selects from the previous form.
I know if this was a regular form I could do something like this:
Dim strSQL as String
Dim stDocName as String
stDocname = "frmMyFomr"
strSQL = "PManager = 'JOHN DOE' "
DoCmd.OpenForm stDocName, , , strSQL
But how can I achieve this type of result when using subforms?
Thanks,
crhodus
I have a subForm (subFollowUp) on my main form (frmTickler). I would like to be able to pass a value to my subform so that only certain records are displayed in the Subform.
The default Record Source for subFollowUp is "SELECT * FROM Projects;".
I'd like to be able to have the Record Source be something like "SELECT * FROM Projects WHERE PManager = 'JOHN DOE';" , depending on what the user selects from the previous form.
I know if this was a regular form I could do something like this:
Dim strSQL as String
Dim stDocName as String
stDocname = "frmMyFomr"
strSQL = "PManager = 'JOHN DOE' "
DoCmd.OpenForm stDocName, , , strSQL
But how can I achieve this type of result when using subforms?
Thanks,
crhodus