What is wrong with the select statement below. I can't get this to work.
I have a table named "Billing People"
It has fields: BillingPhone and Billing People.
The field I just left is Billing Responsibility. I wish to lookup the data from the billing people table and populate the phone number in the current table. Thanks for any help...
Code:
Private Sub Billing_Responsibility_AfterUpdate()
Dim ThePerson As String
Dim Ans As Variant
Dim Txt As String
Dim Expr1 As String
Let ThePerson = Me.Billing_Responsibility
Dim Rec As Recordset
Let Txt = "SELECT [Billing_People.BillingPhone] as Expr1 FROM [Billing_People] where [Billing_People.Billing_Responsibility] =" & "'" & ThePerson & "'"
Let Ans = DLookup("[BillingPhone]", "Billing_People", Txt)
Me.BillingPhone = Ans