Can You Use SQL Max() Function Based on Variable From Form

  • Thread starter maduckie123 via AccessMonster.com
  • Start date
M

maduckie123 via AccessMonster.com

Hello,

I'm wondering if it is possible to execute a SQL query at runtime, from a
Form, and to alter the query programmatically based on a value (variable)
passed from the Form to the query. I am looking to obtain a max value of a
number based that is related to the variable that will (hopefully) be passed
from the Form to the query at runtime.

Thanks,

Cindy
 
K

Klatuu

There are a number of ways this can be accomplished using VBA.
One is to build the query programmatically.
Another is to use a stored query and pass it parameters. You cannot use a
varialbe with this method. You have to put the value in a form control and
reference the control in the query.
If it required more modification than passing a parameter, you can still use
a stored query. You put the SQL of the stored query into a variable and
modify the variable to create the query you execute.
 

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