Programmatically entering query criteria on Form

G

Gwen

Please help

I have written code to dynamcially enter information in
text boxes when the form opens to be used as criteria for
a query. However the query is not getting the info. When
I manually enter the info in the text box the query runs.
What am I missing ? Below is the snippet of code:

For i = 0 To usr.Groups.Count - 1
grpname = usr.Groups(i).Name
strcriteria = strcriteria & "= """ & grpname & """ or "
strcriteria = strcriteria & varname
Next i

Me.criteria = strcriteria

thanks

Gwen
 
C

Chris Large

Hi

What triggers the query to run? I'm guessing its the
textbox After_Update event which will fire when you
manually enter data into it on the form, but not when you
change the value from code. You will need to add code to
run the query after you've changed the value from code.

hth

Chris
 

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