467,915 Members | 1,136 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

City/County table

How do I get a table to autpmatically enter the County name in the next
field when I enter the City name?

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Feb 10 '06 #1
  • viewed: 1807
Share:
4 Replies
Leon wrote:
How do I get a table to autpmatically enter the County name in the next
field when I enter the City name?

In the AfterUpdate event of your for County.
Me.County = Dlookup("County","LookupTable","City = '" & Me.City & "'"
Feb 11 '06 #2
Thanks for your reply.
I am not sure I understand how to set this up.
Could you give me an example?
The following cities are located in Clay County:
Ashland, Barfield, Lineville.
The following cities are located in Calhoun County
Anniston, Oxford,
Thanks
"salad" <oi*@vinegar.com> wrote in message
news:ZH******************@newsread3.news.atl.earth link.net...
Leon wrote:
How do I get a table to autpmatically enter the County name in the next
field when I enter the City name?

In the AfterUpdate event of your for County.
Me.County = Dlookup("County","LookupTable","City = '" & Me.City & "'"


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Feb 11 '06 #3
Thanks for your reply.
I am not sure I understand how to set this up.
Could you give me an example?
The following cities are located in Clay County:
Ashland, Barfield, Lineville.
The following cities are located in Calhoun County
Anniston, Oxford,
Thanks
"Leon" <le**@dillingham.net> wrote in message
news:11*************@sp6iad.superfeed.net...
Thanks for your reply.
I am not sure I understand how to set this up.
Could you give me an example?
The following cities are located in Clay County:
Ashland, Barfield, Lineville.
The following cities are located in Calhoun County
Anniston, Oxford,
Thanks
"salad" <oi*@vinegar.com> wrote in message
news:ZH******************@newsread3.news.atl.earth link.net...
Leon wrote:
How do I get a table to autpmatically enter the County name in the next
field when I enter the City name?

In the AfterUpdate event of your for County.
Me.County = Dlookup("County","LookupTable","City = '" & Me.City & "'"


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Feb 11 '06 #4
Leon wrote:
Thanks for your reply.
I am not sure I understand how to set this up.
Could you give me an example?
The following cities are located in Clay County:
Ashland, Barfield, Lineville.
The following cities are located in Calhoun County
Anniston, Oxford,
Thanks
"salad" <oi*@vinegar.com> wrote in message
news:ZH******************@newsread3.news.atl.earth link.net...
First, open up the property sheet for the City. Click on Event. Click
on AfterUpdate. Select Code.

I have no idea what your table structure is. I don't know your table
names. It would be best if you enter Dlookup then highlight it and then
read the help topic for it.

I figure you have the fields on the form called City and County. I
figure the field in the table are called City and County. I don't know
what the lookup table is called. You'll need to change that table name
in the following code line.

Me.County = Dlookup("County","LookupTable","City = '" & Me.City & "'"
If IsNull(Me.County) Then msgbox "The city you entered is invalid."

Dlookup will return the county and if it isn't found the county will be
null.

I
Leon wrote:
How do I get a table to autpmatically enter the County name in the next
field when I enter the City name?
In the AfterUpdate event of your for County.
Me.County = Dlookup("County","LookupTable","City = '" & Me.City & "'"


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Feb 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by dan | last post: by
3 posts views Thread by Takeadoe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.