Q. Zipcode file project and pop up form.

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi,

I have a new project where I have 1 zip table that contains about
30,000 records, as it has about every city in the USA as of 1990.

Then, I have 2 queries:
One of the queries lists every single field and record.
The other query groups the records by state and gives me instead of
30,000 recors only 50 records, and gives me population totals for each
of the states (using the groupby option in the query)..

Now, I've created a form.
The main form has the query that lists all of the 30K records.
The subform is from the second query that gives the individual state
totals.

On the main form, I've placed a combo box to do a zipcode look-up.
That works fine, as it goes right to the record with the city of the
zipcode.

OK, Now, I want to place a second combo box onto the main form also,
but which has a list of only the 50 state records. Well, the subform
is the one that has the query with the 50 state records behind it, but
I can't seem to get it work, when I tell the combo box to use that
query's state field.

Not sure it's even possible.

Can I get a clue?

Thanks
Jim
 
I understand that your first combobox looks up the corresponding record in
the main form.
What do you want your second combobox to do?
 
I understand that your first combobox looks up the corresponding record in
the main form.
What do you want your second combobox to do?

Oops, I left something out, didn't I ?

The second combo box is to have a list of the 50 states, so I can
click on any one, and the main form will jump to the first state of
the thousands of records.

But I want the control on the main form, and it's the subform that has
the state field that I want (which has only 50 recs).

Thanks,
Jim
 
Your second combobox has a rowsource property, which you can set to point to
the same table as your subform.

HTH
- Turtle
 
Your second combobox has a rowsource property, which you can set to point to
the same table as your subform.

HTH
- Turtle

True, I can do that, but I've tried several different ways, with
different results. One way, the list is blank. Another way, a
message comes and says the "control cant be edited . . . "

And of course, there's the original way, where I set it to the main
form's "state" field, but then I get the 30,000 entries of just AL -
WY state ids

Can you help?
Thanks,
Jim
 
If you have a table tblStates which lists the states in a field named
StateName and the primary key in a field named PK, you could use a RowSource
query like this:
SELECT PK, StateName FROM tblStates Order By StateName

Make sure that your Columns property is set to 2, and your ColumnWidths are
something like this: 0";1".

HTH
- Turtle
 
Back
Top