G
George van Niekerk
I have a table with fields - Financialcompany and companydescription, which i
use in a form to update another table with the same field names. I have used
the following code on the exit event for the Financialcompany filed in the
form.
Private Sub Company_Exit(Cancel As Integer)
Dim varCompanyName As Variant
varCompanyName = DLookup("CompanyDescription", "LTCompanies",
"FinancialCompany =[FinancialCompany] ")
If (Not IsNull(varCompanyName)) Then Me![CompanyName] = varCompanyName
End Sub
The problem is that the CompanyDescription field is updated with the same
description i.e. first record of the Company table, irrespective of the
selection of the financialcompany field in the form. Hope this makes sense.
WHat am i doing wrong?
use in a form to update another table with the same field names. I have used
the following code on the exit event for the Financialcompany filed in the
form.
Private Sub Company_Exit(Cancel As Integer)
Dim varCompanyName As Variant
varCompanyName = DLookup("CompanyDescription", "LTCompanies",
"FinancialCompany =[FinancialCompany] ")
If (Not IsNull(varCompanyName)) Then Me![CompanyName] = varCompanyName
End Sub
The problem is that the CompanyDescription field is updated with the same
description i.e. first record of the Company table, irrespective of the
selection of the financialcompany field in the form. Hope this makes sense.
WHat am i doing wrong?