J
Jim Jones
Hi,
I came across this code, on the web, and don't know how to get in
touch with the author, but they posted it freely (as long as credit
remains in tact).
************* Code Start **************
' This code was originally written by Erika Yoxall.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Erika Yoxall
'
Sub Zip_OnExit(Cancel As Integer)
Dim varState, varCity As Variant
varState = DLookup("State", "tblZipCode", "ZipCode =[Zip] ")
varCity = DLookup("City", "tblZipCode", "ZipCode =[Zip] ")
If (Not IsNull(varState)) Then Me![State] = varState
If (Not IsNull(varCity)) Then Me![City] = varCity
End Sub
'************* Code End **************
I want to use the above code, but don't understand 2 things;
1) Where do can I get a zip code table ?
2) Is "State" the field in the current form ? Or is [Zip] The
field in the current form ?
Thanks,
Jim
I came across this code, on the web, and don't know how to get in
touch with the author, but they posted it freely (as long as credit
remains in tact).
************* Code Start **************
' This code was originally written by Erika Yoxall.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Erika Yoxall
'
Sub Zip_OnExit(Cancel As Integer)
Dim varState, varCity As Variant
varState = DLookup("State", "tblZipCode", "ZipCode =[Zip] ")
varCity = DLookup("City", "tblZipCode", "ZipCode =[Zip] ")
If (Not IsNull(varState)) Then Me![State] = varState
If (Not IsNull(varCity)) Then Me![City] = varCity
End Sub
'************* Code End **************
I want to use the above code, but don't understand 2 things;
1) Where do can I get a zip code table ?
2) Is "State" the field in the current form ? Or is [Zip] The
field in the current form ?
Thanks,
Jim