Trouble accessing the value of a form control in a query

J

Jeremy Saul

I have a query in Access 2000 which uses the value of a form control in an
expression to add a fixed value onto the contents of a field. The query is
run from within a procedure called in response to clicking a button on the
form after some other calculations have loaded the control. The expression
is something like:

Parent: [table1]![parent] + [forms]![form1].[control1]

What I find is that this seems to return a null value when run from the form
as described, but works fine if I run the query directly by double-clicking
on its icon.

Any ideas why the value of the control cannot be accessed when called from a
VB subroutine? The control is unbound. I use a similar technique in other
queries called in the same way with no problems at all, but there the value
of the control is used in the selection criteria to provide a variable
filter.
 

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