G
Guest
Access 2003. Working with Canadian Postal Codes. Have Postal Code definitions
table. When a new individual is added to the members list by way of a form,
the address components are gathered (Building Number, Street Name, Street
Type, Quadrant, City) The objective is to use the address components to
autoselect (assign) the correct postal code from the definitions table, and
display it in the form as well as add it to the table of members.
The tblPostalCodeDefs looks like this:
City Quadrant StreetName StreetType FromBldng# ToBldng# Side PCode
Vegas SW Main St 1411 1759
Odd T3Y 4Z7
Vegas SW Main Ave 216 380
Even T3Y 4Z7
Vegas NW Happy Ave 240 1260
Even T4G 8L4
Of course the defs table has thousands of similar records.
I am very concerned with speed and efficiency. The approach I am considering
is to create successively smaller recordsets from the defs table until a
recordset of one record is created. I would create these successive subsets
by filtering accross the fields of the tblPostCodesDefs from left to right.
The parameters would come from the controls in the member entry form. The
PCode in the last recordset would be chosen, displayed on the form and
assigned to the member. A mis-typed or recorded address will produce an error
message to the operator if a recordset of one record cannot be obtained.
There is also opportunity to display the smallest (last) recordset if the
correct Postal Code remains ambiguous.
Is my approach sound or is there a better approach for this task? Any
critique of my approach or suggested alternates with coding suggestions
would be appreciated.
As always thanks in advance.
table. When a new individual is added to the members list by way of a form,
the address components are gathered (Building Number, Street Name, Street
Type, Quadrant, City) The objective is to use the address components to
autoselect (assign) the correct postal code from the definitions table, and
display it in the form as well as add it to the table of members.
The tblPostalCodeDefs looks like this:
City Quadrant StreetName StreetType FromBldng# ToBldng# Side PCode
Vegas SW Main St 1411 1759
Odd T3Y 4Z7
Vegas SW Main Ave 216 380
Even T3Y 4Z7
Vegas NW Happy Ave 240 1260
Even T4G 8L4
Of course the defs table has thousands of similar records.
I am very concerned with speed and efficiency. The approach I am considering
is to create successively smaller recordsets from the defs table until a
recordset of one record is created. I would create these successive subsets
by filtering accross the fields of the tblPostCodesDefs from left to right.
The parameters would come from the controls in the member entry form. The
PCode in the last recordset would be chosen, displayed on the form and
assigned to the member. A mis-typed or recorded address will produce an error
message to the operator if a recordset of one record cannot be obtained.
There is also opportunity to display the smallest (last) recordset if the
correct Postal Code remains ambiguous.
Is my approach sound or is there a better approach for this task? Any
critique of my approach or suggested alternates with coding suggestions
would be appreciated.
As always thanks in advance.