E
efandango
I have two fields that I want to fill with data. The first field [Postcode]
works just fine. But the 2nd field; [txt_Run_waypoint_ID_From] just gives a
blank; no error messages, just blank.
The field [txt_Run_waypoint_ID_From] is a text field, the lookup field,
[StreetNameID] is an autonumber field.
I have tried different syntax in the code, but nothing seems to work. What
am I doing wrong?
My code:
Private Sub Road_Name_From_AfterUpdate()
Me.txt_Run_waypoint_ID_From = DLookup("[StreetNameID]", "tbl_Street_Names",
"[Run_waypoint_ID_From] = '" & Me.Road_Name_From.Column(0) & "'")
Me.Postcode_From = DLookup("[PostCode]", "tbl_Street_Names", "[StreetNameID]
=" & Road_Name_From.Column(0))
Exit_Road_Name_From_AfterUpdate:
End Sub
works just fine. But the 2nd field; [txt_Run_waypoint_ID_From] just gives a
blank; no error messages, just blank.
The field [txt_Run_waypoint_ID_From] is a text field, the lookup field,
[StreetNameID] is an autonumber field.
I have tried different syntax in the code, but nothing seems to work. What
am I doing wrong?
My code:
Private Sub Road_Name_From_AfterUpdate()
Me.txt_Run_waypoint_ID_From = DLookup("[StreetNameID]", "tbl_Street_Names",
"[Run_waypoint_ID_From] = '" & Me.Road_Name_From.Column(0) & "'")
Me.Postcode_From = DLookup("[PostCode]", "tbl_Street_Names", "[StreetNameID]
=" & Road_Name_From.Column(0))
Exit_Road_Name_From_AfterUpdate:
End Sub