Hi,
I have used function DLookUp as ControlSource to a TextBox in a Form according to:
=DLookUp("[Company]";"[TCompany]";"[ID_Company]=1")
How can I write the same function but I want to store it to a variable in VBA? (In VBA Excel I use WorksheetFunction. to use a built in function) I don't know how to use a built in function in VBA Access.
Code:Dim sCompany As String 'This line doesn't work. Of Course. But how can I write this code? sCompany=DLookUp("[Company]";"[TCompany]";"[ID_Company]=1")