Display records based on button selected in Access 2016

I have created a seating plan in a form for my works building to manage the hosts. I'm wanting to click on a seat and have all details display in the fields at the bottom inc. who sits there, what hosts, make/model of hosts .etc. It's possible for a desk to have multiple hosts (a PC, laptop, Mac .etc), yet only 1 user can be sat there. That's why I've set up multiple record entries at the bottom so up to 3 can be shown. See attached image. Form Each host is associated with a user. Could I display multiple records that are associated with a userid? How could I go about this?  Thanks in advance
Theron HoggAsked:
Who is Participating?
Gustav BrockConnect With a Mentor CIOCommented:
With that many controls, you would use WithEvents  to capture the click events without writing dozens of lines of code.
An example can be found here:

Create Windows Phone Colour Palette and Selector using WithEvents

Dale FyeConnect With a Mentor Commented:
or use something like Screen.ActiveControl.Name to get the name of the image which was clicked.

and in the Click property (dialog box) of each of those controls, enter: =DisplayUserData()

With code like:

Private Function DisplayUserData()

    dim ctrl as control

    set ctrl = me.controls(screen.ActiveControl.Name).Caption

    'add code here to display the data associated with that position.

End Function

Open in new window

Jeffrey CoachmanMIS LiasonCommented:
Can you post your table designs and ERD
(Entity Relationship Diagram)
Gustav BrockCIOCommented:
Solutions provided.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.