Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access form SELECT Statement

Status
Not open for further replies.

Donkeygirl

Technical User
Nov 30, 2000
52
US
ok. Here's the situation. I am working with an Access database. Getting into specifics will not help. Everytime I do, people suggest a route that is not condusive with the needs of the office.

I will do my best to give you an idea of the setup we need.
I have a form and a subform. The first form is an address lookup which has the fields for house number, street, type, direction, city, zip. On command (where I have the select statement ) criteria of the address input is used to find that record in the street table. In that table there are address segments ( ranges on a street) there are also precinct numbers attached to the segment. Each number is a polling place for people to go to on election day.

When the address is found to belong in a segment, the precinct number is pulled and put into the form for a part two. Upon update of the precinct field, the subform is populated with the record for the polling place precinct. This pulled from the polling place table, which contains one record for each precinct number.
If the user types in partial information there is a list of IF ELSE THEN statements:
If 1 result go through process, if less then 1- (msgbx)no match, if more than 1- fill listbox (did I mention the listbox for possible results?), if more than 25- (msgbx) please refine search.

The hard part is that we are working many to one. Well, if you have succumb by this point, I think I understand.
If you think you can help with this step I am at now, here is the SELECT statement I am working on:

SELECT (&quot;*Tblstreet.[PRCNT]*&quot;) FROM Tblstreet WHERE Tblstreet.BEGBLK <= [Forms]![UserEntry]![Number] AND Tblstreet.BLOCK <= [Forms]![UserEntry]![Number] AND Tblstreet.STREET = [Forms]![UserEntry]![street] AND Tblstreet.TYPE LIKE &quot;[Forms]![UserEntry]![type]*&quot; AND Tblstreet.city LIKE &quot;*[Forms]![UserEntry]![city]*&quot; AND Tblstreet.ZIPCODE LIKE &quot;*[Forms]![UserEntry]![zip]*&quot;

I don't mean to waste your time, but when I usually put code down, people want to know more.
Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top