Setting Record Source property to a Query

  • Thread starter Thread starter Jeff A via AccessMonster.com
  • Start date Start date
J

Jeff A via AccessMonster.com

hi,

i've created several queries. i would like to set the Record Source
property of a Continuous Form to a particular query at the code of the form
(since i'll be using different queries according to different conditions).
how do i code/reference this query in code of the form?

Me.RecordSource = (name of query?)

thanks, jeff
 
Jeff,

Me.RecordSource = "name of query"

Will do what you want.

HTH,
Nikos
 
Me.RecordSource = "NameOfQuery"
.... where NameOfQuery is the literal name of the query or ...
Me.RecordSource = strQueryName
.... where strQueryName is the name of a sting variable that contains the
name of the query.

Note the quotes when using the literal name.
 
Back
Top