Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine statements into one 2

Status
Not open for further replies.

vamoose

Programmer
Joined
Oct 16, 2005
Messages
320
Location
MX
I am using MSAccess 2000 and I would like to combine the following statement:

Label176.Visible = True: [BalQty].Visible = True: [ScanBal].Visible = True: [ScanIns].Visible = True

To something like this if possible:

Label176, [BalQty], [ScanBal], [ScanIns].Visible = True

I'm not sure if this is even possible. I think I have tried every possible combination of , ; &

Any suggestions, Thank you.
 
Can you please explain what you want to happen?
 
I want to shorten or condense the 4 individual statements into one, that's all, to make it more readible or cleaner.

Thank you
 
That is what you want to do, I need to know what you want to happen? That is, if such and such is visible, I want these to be visible too.
 
I just want to say:

This1 and this2 and this3 and this4.visible = true

rather than

This1.visible=true: This2.visible=true: This3.visible=true: This4.visible=true
 
You could add tags to the controls or you could create a list of controls:

Code:
astrVisible=Split("This1,This2,This3",",")

For i=0 To Ubound(astrVisible)

   Me(astrVisible(i)).Visible=True

Next
 
vamoose,

Remou has offered a good alternative to your question. I am about 99.99% sure there is no "shorthand" method to do what you want....I know I have searched for a way many times. But I soon came to the realization that the full method is probably better anyway...for when you return to the code 6 months after you last looked at it. It will make much more sense leaving if fully written.

Remou,

If you did not gather, vamoose wanted to be able to shortcut the writing of the parent.control.property=value for several controls into something like parent.controlarray.property=value in an effort to not have to repeat the structure over and over. He wanted to compare four controls against true/false in one swift line of check.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
mstrmage1768
I got that, I just hate saying 'No' :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top