Access form - how to make a text field a control source from an SQL query?

Background

I have two tables:

  • Projects
    • EmployeeID
  • Employee
    • EmployeeID
    • Name

I have a request. I base the form on the contained among other elements:

SELECT e.Name FROM Projects p JOIN Employee e ON e.EmployeeID=p.EmployeeID

When I make a form in Access based on this request, I can very easily display e.Nameon my form because it is associated with the request.

My real example, of course, is much more complicated than this simple example. The above works just fine for queries and read-only scales. However, I would like to use the Splitform view, and this becomes very slow since many connections for a small number of record sets. Given that a large percentage of my joins are simple as above, I hope for a way to remove as many as possible.

e.Name .

. - Projects.EmployeeID, Employee.Name .

, - , . , , .

VBA , , , , .

.

  • Access, ?
+1
1

Dlookup,

Dlookup, :

=DLookUp("Name", "Employee", "EmployeeID =" & "[EmployeeID]"

ControlSource .

:

  • & , ,
  • [EmployeeID] , . , "EmployeeID" , , ""
+1

Source: https://habr.com/ru/post/1528181/


All Articles