Good Afternoon!
I'm trying to use the DLookup function to populate 2 or 3 unbound fields on a form based on the selection of a dropdown field on the same form. The information needed to populate the unbound fields is pulled from a query on which the dropdown field is based. Thus...all the info can be pulled from the same query. However, my DLookup is not working. The name of the query is "Names" and I'm trying to use the "Index" field to control the selection to account for multiple similar last names. See below:
Private Sub Form_Current()
Dim LastName As Variant
LastName = DLookup("[LastName]", "Names", "[Index] =" & Forms![Names]!Index)
End Sub
Suggestions?
JAM
I'm trying to use the DLookup function to populate 2 or 3 unbound fields on a form based on the selection of a dropdown field on the same form. The information needed to populate the unbound fields is pulled from a query on which the dropdown field is based. Thus...all the info can be pulled from the same query. However, my DLookup is not working. The name of the query is "Names" and I'm trying to use the "Index" field to control the selection to account for multiple similar last names. See below:
Private Sub Form_Current()
Dim LastName As Variant
LastName = DLookup("[LastName]", "Names", "[Index] =" & Forms![Names]!Index)
End Sub
Suggestions?
JAM