Using variables in record source

  • Thread starter Neil via AccessMonster.com
  • Start date
N

Neil via AccessMonster.com

i have a global variable which i wish to use in a where statement in the
record source of the form
is this possible or do i need to change the record source in the vb code
itself

thanks in advance Neil
 
R

Rick Brandt

Neil said:
i have a global variable which i wish to use in a where statement in
the record source of the form
is this possible or do i need to change the record source in the vb
code itself

thanks in advance Neil

VBA variables are only accessible directly within VBA code. In a
form/report expression or in a query you first need to create a custom
function that returns the value of the variable and then use the function in
your expression or query.
 
N

Neil via AccessMonster.com

Cheers Rick :)

Rick said:
VBA variables are only accessible directly within VBA code. In a
form/report expression or in a query you first need to create a custom
function that returns the value of the variable and then use the function in
your expression or query.
 

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