Display records based on button selected in Access 2016

Theron Hogg
Theron Hogg used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
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

/gustav
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
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 Liason
Most Valuable Expert 2012

Commented:
Can you post your table designs and ERD
(Entity Relationship Diagram)
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Solutions provided.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial