How do you get record sets?

G

Guest

I got a form with a combo box to look up CUSTOMERS names (tblCustomer)
From the customers I want to run a query to find the number of pieces of
equipment and the description. I got the query to work.
I thought I would do a FOR-NEXT loop based on the count to make my textboxes
visible and populate the textboxes with the descriptions.
I just cant seem to tie it all together
 
J

John Vinson

I got a form with a combo box to look up CUSTOMERS names (tblCustomer)
From the customers I want to run a query to find the number of pieces of
equipment and the description. I got the query to work.
I thought I would do a FOR-NEXT loop based on the count to make my textboxes
visible and populate the textboxes with the descriptions.
I just cant seem to tie it all together

You need only a single line of code. Just base the Form on a query
referencing the combo box as a Criterion:

=[Forms]![NameOfYourForm]![NameOfTheCombo]

as a criterion on CustomerID. Base the Form on this query and requery
the form in the afterupdate event of the combo.

John W. Vinson[MVP]
 
G

Guest

I don’t think that what I’m after.
On my form I will have about 50 textboxes visible set to NO
From the query count I will make visible that number of textbox to display
the description and enter some data.

--
thank You


John Vinson said:
I got a form with a combo box to look up CUSTOMERS names (tblCustomer)
From the customers I want to run a query to find the number of pieces of
equipment and the description. I got the query to work.
I thought I would do a FOR-NEXT loop based on the count to make my textboxes
visible and populate the textboxes with the descriptions.
I just cant seem to tie it all together

You need only a single line of code. Just base the Form on a query
referencing the combo box as a Criterion:

=[Forms]![NameOfYourForm]![NameOfTheCombo]

as a criterion on CustomerID. Base the Form on this query and requery
the form in the afterupdate event of the combo.

John W. Vinson[MVP]
 
J

John Vinson

I don’t think that what I’m after.
On my form I will have about 50 textboxes visible set to NO
From the query count I will make visible that number of textbox to display
the description and enter some data.

Your table structure is very suspect, then, and you're making
something which would be very easy with a properly normalized set of
tables into something vastly more difficult. Do these fifty textboxes
end up in fifty different fields in a single record? I don't
understand where the data is coming from or what you want to do with
it!

John W. Vinson[MVP]
 
G

Guest

The form I’m working with is link to three main tables.
tblCustomer, tblEquipment & tblIncome
the tblCustomer has about 75 records
the tblEquipment (right now) has about 350 records
and the tblIncome keeps a running weekly record and it grows each week.
I have a query that print a report that tells me Customer 1 has Equipment
A,B&C
Customer 2 has Equipment D,E,F&G and Customer 3 has Equipment X,Y&Z and so on.
The most pieces of Equipment any one Customer has is about 25 now but it
could be more or less and it does change, So I thought I would be safe using
50 text boxes. It would be nice if I could use a dynamic text boxes but I
don’t think you can do that.
So on my form when I look up the Customers name using a combo Box I would
like it to look at the query give me a count for the number of pieces of
Equipment that is at the Customers location. Make visible the appropriate
text boxes or (caption on labels) and populate with text (the description of
the Equipment). And I would also make visible text boxes next to the
description so I could enter the income from that piece of equipment.
Can it be done?
 

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