I have been searching for 2 weeks on how to mkae this work.
I have a form with a dropdown list. In the afterupdate event I have the following code:
Private Sub BreederID_AfterUpdate()
BreederFirstName = DLookup("[BreederFirst]", "Breeder", "BreederID=" & BreederID)
BreederLastName = DLookup("[BreederLast]", "Breeder", "BreederID=" & BreederID)
BreederAddress = DLookup("[BreederAddress]", "Breeder", "BreederID=" & BreederID)
BreederCity = DLookup("[BreederCity]", "Breeder", "BreederID=" & BreederID)
BreederState = DLookup("[BreederState]", "Breeder", "BreederID=" & BreederID)
BreederZip = DLookup("BreederZip", "Breeder", "BreederID=" & BreederID)
BReederPhone = DLookup("BreederPhone", "Breeder", "BreederID=" & BreederID)
End Sub
The list is populating the fields for the contact information for each breeder on the form. It works fine, the problem is that if a different selection is made in the dropdown list, it doesn't update the fields. It keeps the original selection.
Is there something I am doing wrong? Can anyone help?
Thanks,
Tim
I have a form with a dropdown list. In the afterupdate event I have the following code:
Private Sub BreederID_AfterUpdate()
BreederFirstName = DLookup("[BreederFirst]", "Breeder", "BreederID=" & BreederID)
BreederLastName = DLookup("[BreederLast]", "Breeder", "BreederID=" & BreederID)
BreederAddress = DLookup("[BreederAddress]", "Breeder", "BreederID=" & BreederID)
BreederCity = DLookup("[BreederCity]", "Breeder", "BreederID=" & BreederID)
BreederState = DLookup("[BreederState]", "Breeder", "BreederID=" & BreederID)
BreederZip = DLookup("BreederZip", "Breeder", "BreederID=" & BreederID)
BReederPhone = DLookup("BreederPhone", "Breeder", "BreederID=" & BreederID)
End Sub
The list is populating the fields for the contact information for each breeder on the form. It works fine, the problem is that if a different selection is made in the dropdown list, it doesn't update the fields. It keeps the original selection.
Is there something I am doing wrong? Can anyone help?
Thanks,
Tim