Form query criteria doesn't recognize function

H

H. Martins

I have a listbox linked to a querie.

In some form, listboxA query criteria must respect some value stored
in listboxB.

Looks like queries can't read the content of a listboxB directly, so I
wrote a Static Function that reads listboxB and returns the value for
the query criteria of listboxA as Me.lstbxAlunos.Column(0)

It works OK.

====

Now I have a form without a RecordSource. The form opens displaying "?
name#". It's OK. That form has a ListBox whose RecordSource have an
independente criteria. Selecting a row in that listbox defines a
criteria to the form itself.

Again, to be able to get it running, form's RecordSoure is established
to a query whose criteria depends on the ListBox selection when
something is clicked. Again, I wrote a static function to return to
the query the value of the listbox exactly the same way as the example
above. It doesn't work. Looks like the query doesn't see the function
or doesn't get the listbox value from the function.

Can I have some help, please?
Thanks
H. Martins
 
H

H. Martins

.... when a button is clicked Access it asks me for the value of the
function.

Thanks
H. Martins
 

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