Changing the RecordSource on a Form programmatically

D

Douglas J. Steele

The form must be open, and you use something like:

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

or

Forms("NameOfForm").RecordSource = "SQLStatement"
 
J

Juan F Mena

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
 
D

Douglas J. Steele

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.
 

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

Top