?
Solved

Concatenating a string to get a control name that I can use in VBA

Posted on 2007-10-15
1
Medium Priority
?
565 Views
Last Modified: 2008-01-09
Hi Gurus
I am getting the following strings coming from MSComm1 : *4-BUTTON,1  OR  *3-BUTTON,2  
This indicates that a button has been pressed on either unit 3 or unit 4  the number at the end of the string indicates the button number that was pressed.  Is there anyway that I can concatenate this information to give me the name of a specific control on my form  i.e "Light1"   or "Light2" that VBA will recognise and that I can reference without giving me errors.
Many thanks
Alan
0
Comment
Question by:caandal
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 20076871
me.controls("light" & Right(myinputstring,1))
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question