D
Dic_nutana
Hi hope you can help I am having problems with dlookup.
I’m using access 2000 and I’m trying to retrieve the ‘email’ address
contained in a table called ‘contacts’ by using two fields i.e. ‘last name’
and ‘first name’ as the criteria, which the end user enters onto a form
I tried referencing just one field but as you know this only returns to
first occurrence of the ‘last name’ found,
I used this code :-
Private Sub eryc_rep_last_AfterUpdate()
[email eryc] = DLookup("", "Contacts", "[surname] = [ERYC Rep Last] ")
End Sub
which worked as far as it goes.
I then tried this :-
Private Sub eryc_rep_last_AfterUpdate()
[email eryc] = DLookup("[email]", "Contacts", "[surname] = ' " & [eryc rep
last] & " ' And [FirstName]= ' " & [ERYC Rep first])
End Sub
but it fails and I not sure where I have gone wrong and where to go from here.
Thanks in advance
I’m using access 2000 and I’m trying to retrieve the ‘email’ address
contained in a table called ‘contacts’ by using two fields i.e. ‘last name’
and ‘first name’ as the criteria, which the end user enters onto a form
I tried referencing just one field but as you know this only returns to
first occurrence of the ‘last name’ found,
I used this code :-
Private Sub eryc_rep_last_AfterUpdate()
[email eryc] = DLookup("", "Contacts", "[surname] = [ERYC Rep Last] ")
End Sub
which worked as far as it goes.
I then tried this :-
Private Sub eryc_rep_last_AfterUpdate()
[email eryc] = DLookup("[email]", "Contacts", "[surname] = ' " & [eryc rep
last] & " ' And [FirstName]= ' " & [ERYC Rep first])
End Sub
but it fails and I not sure where I have gone wrong and where to go from here.
Thanks in advance