find all records within a specified zio code radius in Access

P

Pat J.

How do I create a way to key in a zip code and specified radius in order to
have all records in my Access database within that radius come up? I am not
an experienced programmer. Thank you!
 
K

KARL DEWEY

First do you have a field the includes the radius information?
How do I create a way to key in a zip code and specified radius
The wording here is that a record must be in the Zip code and within the
radius. Is that correct? Or do you want any with that Zip and also any
within the radius even if not in the ZIP?

Use the following as Criteria for Zip--
Like [Enter Zip code or Zip start - 031] & "*"

Use the following as Criteria for Radius--
Iif([Enter Radius (Miles)] Is Null, 0, <= [Enter Radius (Miles)] )

If they must meet both criteria then enter the above criteria on the same
line.
 
P

Pat J.

Karl,

Thank you for your response! This function would be a great help to me in my
self-employment job.

No, I don't have a radius field. I could add it to the table my database
uses. (I only have 1 table and 1 database that I use.) Should I add it?

I want to pull up any record with that Zip and also any record within the
radius even if not in the ZIP (other cities in the same state as well as
other cities in bordering states).

Example: All the records with cities in and within 120 miles of zip code
60438.

In your instructions, do you mean I should create a macro or a filter for a
form? I do use filters and have also created several macros.

If it's a macro, could you please enter the information from the example in
the enter areas in your instructions so I can see exactly how it should be
structured?

Thanks!



KARL DEWEY said:
First do you have a field the includes the radius information?
How do I create a way to key in a zip code and specified radius
The wording here is that a record must be in the Zip code and within the
radius. Is that correct? Or do you want any with that Zip and also any
within the radius even if not in the ZIP?

Use the following as Criteria for Zip--
Like [Enter Zip code or Zip start - 031] & "*"

Use the following as Criteria for Radius--
Iif([Enter Radius (Miles)] Is Null, 0, <= [Enter Radius (Miles)] )

If they must meet both criteria then enter the above criteria on the same
line.

Pat J. said:
How do I create a way to key in a zip code and specified radius in order to
have all records in my Access database within that radius come up? I am not
an experienced programmer. Thank you!
 
K

KARL DEWEY

No, I don't have a radius field. I could add it to the table my database
uses. (I only have 1 table and 1 database that I use.) Should I add it?
You will need to add such a field and populate it unless you can buy some
software from the Post Office that will do it for you.
In your instructions, do you mean I should create a macro or a filter for a
form? I do use filters and have also created several macros.
What I posted was criteria for your query. Open the query in design view.
Add the criteria in the design grid row that is labeled Criteria.
KARL DEWEY said:
First do you have a field the includes the radius information?
How do I create a way to key in a zip code and specified radius
The wording here is that a record must be in the Zip code and within the
radius. Is that correct? Or do you want any with that Zip and also any
within the radius even if not in the ZIP?

Use the following as Criteria for Zip--
Like [Enter Zip code or Zip start - 031] & "*"

Use the following as Criteria for Radius--
Iif([Enter Radius (Miles)] Is Null, 0, <= [Enter Radius (Miles)] )

If they must meet both criteria then enter the above criteria on the same
line.

Pat J. said:
How do I create a way to key in a zip code and specified radius in order to
have all records in my Access database within that radius come up? I am not
an experienced programmer. Thank you!
 

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