Query by Form

G

Guest

I set the criteria for a query in a roundabout way. I wonder if there is a
more direct approach.

I have about 50 text boxes on a form called Main_Form. When Main_Form
opens, the underlying query runs 50 times. After the query runs the first
time, text box 1 displays the contents of a field called Furnish (from the
query). Then the query criteria are reset, the query runs a second time and
text box 2 displays the contents of the field, Furnish. When the query has
run 50 times, the 50 text boxes display the various contents of the field
Furnish that results from the query.

The query criteria refers to a text box in Main_Form called RowNum. In a
Private Sub that runs when the form opens, VBA code sets the contents of
RowNum to the 1st criteria (call it criteria #1). Then the code runs the
Requery method and sets the contents of text box 1 to the field, Furnish.
Then the sequence repeats for criteria #2.

It seems that I am setting the criteria for the query in an indirect way
(VBA code places the criteria in the text box RowNum and then the query gets
the criteria from the text box). Is there a more direct way to set the
criteria?

Thanks.

Jim
 
D

Duane Hookom

I am having trouble understanding what you are attempting to do and why. 50
text boxes and 50 times running a query sounds very unusual.

Do you have some requirements or specs or pseudo code that explains this a
bit better?
 

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