A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing the RecordSource on a Form programmatically



 
 
Thread Tools Display Modes
  #1  
Old October 3rd, 2009, 01:08 PM posted to microsoft.public.access.forms
Juan F Mena
external usenet poster
 
Posts: 3
Default Changing the RecordSource on a Form programmatically

How I can change the Record Source programmatically on a predetermine Form?

EggHeadCafe - Software Developer Portal of Choice
ASP.NET TraceListener for Debugging
http://www.eggheadcafe.com/tutorials...tener-for.aspx
  #2  
Old October 3rd, 2009, 01:26 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Changing the RecordSource on a Form programmatically

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

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

or

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Juan F Mena wrote in message ...
How I can change the Record Source programmatically on a predetermine
Form?

EggHeadCafe - Software Developer Portal of Choice
ASP.NET TraceListener for Debugging
http://www.eggheadcafe.com/tutorials...tener-for.aspx



  #3  
Old October 4th, 2009, 09:42 AM posted to microsoft.public.access.forms
Juan F Mena
external usenet poster
 
Posts: 3
Default Record Source programmatically.

Thanks!!! Is there any way to update the record source from another form?



Douglas J. Steele wrote:

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

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

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

or

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(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/tutorials...raph-cont.aspx
  #4  
Old October 4th, 2009, 11:34 AM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Record Source programmatically.

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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Juan F Mena wrote in message ...
Thanks!!! Is there any way to update the record source from another form?



Douglas J. Steele wrote:

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

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

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

or

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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(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/tutorials...raph-cont.aspx



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.