Hi all, not sure how to describe my problem but I'll give it a go...

I am designing a simple app to show the layout of an office. I have used buttons to represent 'chairs' and image boxes to display desks.

The idea is, when I click a button, the button turns green and text boxes fill with information such as: Username, login name, PC name, etc. And the button itself turns green.

I've done this bit and it all works fine. However, I added some 'reverse' code. ie: Added a button to search the database for a user. For this, I have a search button. When clicked an input box asks 'Enter user name', then it goes away and finds all the above details and populates the boxes.

However, it doesn't turn the button (the 'chair') green on the 'map' - which of course it wouldn't do, as it has no way of knowing which of the 200 buttons on the form relates to the selected user.

Here's my question:

How can I make it so that when the records are populated, it colours the relevant button?

If I know the name of the button to colour in, I can simply use btnSeat10.color = color.green etc. Is it possible to do something like this...

Dim strSeat as String
btn &strSeat.color = color.green

Obviously this doesn't work, as it isn't valid syntax (VB can be sooooo frustrating sometimes!).

Hope you understand my query, I look forward to any suggestions.

Thanks,
Shifty.