Hi everybody - Happy St. Patrick's Day Eve to ya.
Sorry in advance for writing so much, but I come from the school of thought that the more you explain at the beginning, the less confusion that's caused later on. Of course making sense in the first place is always important.....
In Access (I have tried with 2003 and 2007), I can assign properties quickly to controls by grouping them like so:
Dim this1 as control
For each this1 in me.form
If Instr(1,this1.name,"start")>0 then
What this does in Access (which I usually trigger via a button or an event when the form loads) is make visible all the controls in the form that have "start" as part of the name of the control. Any control in the form that doesn't have "start" in the name will go invisible.
Does anyone know what the equivalent of this is in VB Script? Is it even possible to do this, or something similar (I'm flexible!) to this in VB Script? I have a pretty complex page of elements (a bunch of div "id" elements to be exact) and rather than going in and typing 4 lines of the same code for 10 different div ids, I would like to try the same thing I would do in Access and use 7 or 8 lines of code than 40 to update the form elements. Sorry for running on with that last sentence by the way.
Is it possible to do something like the code above in VB Script? I tried the following and VB Script doesn't like it. Microsoft Scripting Editor errored on the For Each line and said "Object doesn't support this property or method."
For each this1 in document.body
If instr(1,this1.id,"start")>0 then
And I know I could nest some divs inside others to some of what I'm trying to do, but unfortunately I'm using the divs in a lot of different areas in the document's body. I am self-taught on Access quite well, but VB Script is still something I'm learning more of as I go along. Hopefully there's a similarity between the two when it comes to mass updating controls/elements because it would save me a lot of time writing out lines.
Thanks in advance for any help you can give.