H
helenp
I've been trying to work my way through something I got
from the Access Web, code to automatically fill in
certain fields on a form based on the value placed in
another field. I'm getting a hazy idea of how the process
should work, but I'm struggling with some of the
specifics. This is the sample code:
Sub Zip_OnExit(Cancel As Integer)
Dim varState As Variant
varState = DLookup("State", "tblZipCode", "ZipCode =
[Zip]")
If (Not IsNull(varState)) Then Me![State] = varState
End Sub
I think the part that's tripping me up is how the first
and third elements in the DLookup statement relate to my
own tables and fields. I'm not sure what they refer to:
fields/labels/whatever on the form, in the lookup table,
in the destination table, or resort spas on Mars. This is
all new to me, so any help in deciphering this would be
most appreciated...
Thanks,
Helen
from the Access Web, code to automatically fill in
certain fields on a form based on the value placed in
another field. I'm getting a hazy idea of how the process
should work, but I'm struggling with some of the
specifics. This is the sample code:
Sub Zip_OnExit(Cancel As Integer)
Dim varState As Variant
varState = DLookup("State", "tblZipCode", "ZipCode =
[Zip]")
If (Not IsNull(varState)) Then Me![State] = varState
End Sub
I think the part that's tripping me up is how the first
and third elements in the DLookup statement relate to my
own tables and fields. I'm not sure what they refer to:
fields/labels/whatever on the form, in the lookup table,
in the destination table, or resort spas on Mars. This is
all new to me, so any help in deciphering this would be
most appreciated...
Thanks,
Helen