Solved

How populate state after entering a zip code

Posted on 2014-03-19
1
227 Views
Last Modified: 2014-03-19
I have a zipcode table setup which contains just the 5 digit zip code.  But we are going to enter the Zip +4 in a field.  For the afterupdate event of the zip code field I have this:

   txtState = DLookup("State", "tblZipCodeDirectory", "ZipCode = " & Me.txtZipCode)

But we're entering the zip +4 data in the first field.  How do I ignore the +4 part of it to do the DLookup?

--Steve
0
Comment
Question by:SteveL13
1 Comment
 
LVL 9

Accepted Solution

by:
dustock earned 500 total points
ID: 39939866
Try the left function to only take the first 5 characters

Left(Me.txtZipCode,5)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now