Changing the RecordSource on a Form programmatically

  • Thread starter Thread starter Juan F Mena
  • Start date Start date
The form must be open, and you use something like:

Forms("NameOfForm").RecordSource = "NameOfQuery"

or

Forms("NameOfForm").RecordSource = "SQLStatement"
 
Thanks!!! Is there any way to update the record source from another form?



Douglas J. Steele wrote:

Re: Changing the RecordSource on a Form programmatically
03-Oct-09

The form must be open, and you use something like

Forms("NameOfForm").RecordSource = "NameOfQuery

o

Forms("NameOfForm").RecordSource = "SQLStatement

--
Doug Steele, Microsoft Access MV
http://I.Am/DougSteel
(no private e-mails, please

<Juan F Mena> wrote in message
EggHeadCafe - Software Developer Portal of Choice
JavaScript Bar Graph Control
http://www.eggheadcafe.com/tutorial...f-57bba826f2a3/javascript-bar-graph-cont.aspx
 
Sure. You can run that code from anywhere. The only caveat is that the form
whose RecordSource you're trying to change has to be open. That means you
may need to open the form first, either in Normal view or in Design view.
 
Back
Top