944,138 Members | Top Members by Rank

Ad:
Nov 9th, 2007
0

VB Var refering to object in access form

Expand Post »
Hi.,

I am busy with another access project when an idea occurred to me. Is it possible to refer to an object, lets say a command button - "Com12" using a VB expression. In application as follows:

Do until cnt = 15
str = "Com"&Cstr(cnt)
str.visible = True *****
cnt = cnt +1
loop

where str is string, and cnt is integer.

Normally i would do this:
com12.visible = true,
but the problem comes in where i would need to assign a value to a whole lot of objects.

Is there a way that I can use a varible, defined in a function or procedure to refer to an object in VB?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JaceDBN is offline Offline
11 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB > Access2000 Database Upgrade Path
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How to access rptImage Control of data report runtime?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC