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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

PLEASE HELP: Refresh columns displayed in a report from a query ou



 
 
Thread Tools Display Modes
  #11  
Old June 4th, 2010, 10:13 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default PLEASE HELP: Refresh columns displayed in a report from a quer

sam wrote:
This worked out perfect! Thanks a LOT!


Good to hear that you were able to figure out the details
and get it working.

The amount of code could be reduced by naming the user
selectable text boxes on the form similar to the way they
are named in the report. Then you could use a loop instead
of having a block of code for each form text box.


Do you know anything about storing sub routines and SQL queries as column
values and executing them through VBA?


VBA code must be compiled before it can be executed.
Because that is a design time action, you can not put code
anywhere other than in a module.

You can use the Eval function to evaluate a text string that
is a valid expression. The expression has the same
limitations as a text box expression (eg. no VBA variables).
However, you can use public functions you have created in a
standard module in an expression. If you can figure out a
way to do what you want by just running a function, then you
can specify the name of a function in a Text table field and
use a line of code in an appropriate event to call the
function:
Eval(rs!somefield & "()")

OTOH, SQL statements in a text string can be executed, so
you can put those in a table. The code to run an action
query could be:
db.Execute rs!fieldwithSQLstatement
Or, for Select queries, you would be more likely to want to
use them as a form's record source:
Me.RecordSource = rs!fieldwithSQLstatement

--
Marsh
MVP [MS Access]
 




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 04:37 PM.


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