How do I put an objects name into a variable?

R

rich

Hi,
I have several text boxes that have object names such as: obj_1_1,
obj_1_2, obj_1_3, obj_2_1, obj_2_2 ,etc

I would like to use the same script on each object. The script would be
then dependant on the 2 numbers used at the end of the object.

The problem I'm having is trying to find a command that can but the
object name into a variable for me to manipulate.

Can anyone help me out?

Thanks in advance

Rich
 
J

Jezebel

You can't really do this in VBA. You might be able to solve your problem
with code along these lines --

Dim pControl as control

For each pControl in Me.Controls
if pControl.Name like "obj_*" then
SomeFunction txt:=pControl
end if
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top