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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top