Run a function without a different argument value

Leen

Registered User.
Local time
Today, 18:13
Joined
Mar 15, 2007
Messages
56
Hi,

How exactly do you run a function with a different argument value?

For now, I run a form and via this way I give the variable "intputlayers" a value, used in the following function:

Code:
Function QChecks(inputlayers As String)

However, I want to run this form standalone, without form.

So, how can I let a user define (not using code but via a macro/query or so) a value for "inputlayers" in an easy way, so that I can run this function on a value entered? Or how can this function be run on a argument set by a user?

Thanks for any help!
Leen
 
Hi,

How exactly do you run a function with a different argument value?

For now, I run a form and via this way I give the variable "intputlayers" a value, used in the following function:

Code:
Function QChecks(inputlayers As String)

However, I want to run this form standalone, without form.

So, how can I let a user define (not using code but via a macro/query or so) a value for "inputlayers" in an easy way, so that I can run this function on a value entered? Or how can this function be run on a argument set by a user?

Thanks for any help!
Leen
Not totally sure if this is what you are looking for, but you would use an INPUTBOX to capture the value, so anywhere you call the function, whether it be in a query, a macro, etc. you would use

QChecks InputBox("Enter Value", "QChecks Input")

Depending on where you put it (a query, for example, you may need other parentheses:

QChecks(InputBox("Enter Value", "QChecks Input"))
 
Hi,

I do not really understand exactly. How can I use a query to do that? To run this function with another value as argument?

Do I need to change the code of the function itself by putting an input box when I call the function itself? Or this inputbox can serve independently to give a value to the argument "inputlayers" - independently from the form.

And how can I call a function from a query? When I open a query, I get the option to add tables or other query's, but no functions..

Thanks again!
Leen
 
Here's a quick view of how to do it in a query. If you need user input to capture it, I would highly suggest using a form to capture the user input.

funcinqry01.png




funcinqry02.png



funcinqry03.png



funcinqry04.png



funcinqry05.png



funcinqry06.png



funcinqry07.png



funcinqry08.png
 

Users who are viewing this thread

Back
Top Bottom