Locopete99
Registered User.
- Local time
- Today, 11:00
- Joined
- Jul 11, 2016
- Messages
- 163
Hi Guys,
Can someone check my code for me and point out where I'm going wrong?
I have a table called Tbl_Salesman. It has 4 fields
Salesman
RSM
Salesmans E-mail
RSM E-mail.
I have a combo box on my form that allows me to link these in so that the user selects the Salesman and an e-mail button picks up the e-mail for the salesmand and RSM.
I have another form that is linked to the main form, which I also intend to put an e-mail button on. I have the salesman field on the form, but hidden.
I'm trying to use the below code to find the respective e-mails. Can someone tell me where its going wrong?
At the moment I'm getting a syntax error on "Salesman E-mail" and i fear I'll have a few more once thats sorted!
Can someone check my code for me and point out where I'm going wrong?
I have a table called Tbl_Salesman. It has 4 fields
Salesman
RSM
Salesmans E-mail
RSM E-mail.
I have a combo box on my form that allows me to link these in so that the user selects the Salesman and an e-mail button picks up the e-mail for the salesmand and RSM.
I have another form that is linked to the main form, which I also intend to put an e-mail button on. I have the salesman field on the form, but hidden.
I'm trying to use the below code to find the respective e-mails. Can someone tell me where its going wrong?
Code:
Dim Salesman As Variant
Dim RSM As Variant
Salesman = DLookup("Salesman E-mail", "Tbl_Salesman", Me.[Salesman])
RSM = DLookup("RSM E - mail", "Tbl_Salesman", Me.[Salesman])
At the moment I'm getting a syntax error on "Salesman E-mail" and i fear I'll have a few more once thats sorted!